我正在使用角度编译器:
const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
使用这些编译器选项:
"angularCompilerOptions": {
"genDir": "./build/compiled",
"outDir": "./build/compiled",
"skipMetadataEmit": true,
"debug": true},
我的 package.json 的相关部分是:
"@ngtools/webpack": "^6.0.0",
"@angular/router": "^5.2.0",
"webpack": "4.8.3",
"webpack-cli": "2.1.4",
我的 angularCompilerPlugin 配置是:
new AngularCompilerPlugin({
tsConfigPath: 'path-to-tsconfig.webpack.json',
entryModule: 'path-to-app.module#AppModule',
sourceMap: true
}),
使用这些配置,我得到:
ERROR in ./$$_lazy_route_resource lazy namespace object
Module not found: Error: Can't resolve 'path-/alerts/module.ngfactory.js' in 'path-to-app-folder/$$_lazy_route_resource'
@ ./$$_lazy_route_resource lazy namespace object
@ ./node_modules/@angular/core/esm5/core.js
@ multi core-js/shim classlist.js reflect-metadata zone.js/dist/zone jquery/dist/jquery rxjs/Rx lodash jquery.panzoom moment moment-timezone @angular/common @angular/core @angular/http @angular/router @angular/forms semantic
请任何方向或帮助。