所以我有这个npm脚本
"scripts": {
...
"aot": "./node_modules/.bin/ngc -p tsconfig.json"
}
在tsconfig.json中,我拥有
{
"compilerOptions": {
"experimentalDecorators": true,
"lib": [ "dom", "esnext" ],
"target" : "ES2018",
"baseUrl": "./src",
"moduleResolution": "node",
"module": "commonjs",
"sourceMap": true,
"inlineSources": true
},
"angularCompilerOptions": {
"genDir": "./ngfactories",
"skipMetadataEmit" : true
}
}
我使用的软件包
"devDependencies": {
"@angular/compiler-cli": "^6.1.9",
"typescript": "^2.9.2",
"@ngtools/webpack": "^6.2.2",
...
},
dependencies: {
"@angular/compiler": "^6.1.9",
...
}
问题是,运行npm run aot
不会在genDir指定的./ngfactories目录中生成.ngfactory.js文件等。而是将它们与原始.ts文件一起生成。我在做什么错,如何使angular编译器在适当的./ngfactories目录中生成ngfactor?