mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
feat(webpack): disable aot flag, optional angular dep and tsconfig utils (#9711)
Co-authored-by: Igor Randjelovic <rigor789@gmail.com>
This commit is contained in:
@ -26,6 +26,7 @@ import {
|
||||
getPlatform,
|
||||
getPlatformName,
|
||||
} from './platform';
|
||||
import { readTsConfig } from './tsconfig';
|
||||
|
||||
// intentionally populated manually
|
||||
// as this generates nicer typings
|
||||
@ -75,4 +76,7 @@ export default {
|
||||
addVirtualEntry,
|
||||
addVirtualModule,
|
||||
},
|
||||
tsconfig: {
|
||||
readTsConfig,
|
||||
},
|
||||
};
|
||||
|
19
packages/webpack5/src/helpers/tsconfig.ts
Normal file
19
packages/webpack5/src/helpers/tsconfig.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { readConfigFile, parseJsonConfigFileContent, sys } from 'typescript';
|
||||
import { dirname } from 'path';
|
||||
|
||||
export function readTsConfig(path: string) {
|
||||
const f = readConfigFile(path, sys.readFile);
|
||||
|
||||
const parsed = parseJsonConfigFileContent(
|
||||
f.config,
|
||||
{
|
||||
fileExists: sys.fileExists,
|
||||
readFile: sys.readFile,
|
||||
readDirectory: sys.readDirectory,
|
||||
useCaseSensitiveFileNames: true,
|
||||
},
|
||||
dirname(path)
|
||||
);
|
||||
|
||||
return parsed;
|
||||
}
|
Reference in New Issue
Block a user