_lazy_route_resource惰性名称空间对象 [英] _lazy_route_resource lazy namespace object
本文介绍了_lazy_route_resource惰性名称空间对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用角度编译器:
const AngularCompilerPlugin = require('@ ngtools / webpack')。AngularCompilerPlugin;
I'm using angular compiler:
const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
使用以下编译器选项:
"angularCompilerOptions": {
"genDir": "./build/compiled",
"outDir": "./build/compiled",
"skipMetadataEmit": true,
"debug": true},
package.json的相关部分是:
Relevant part of my package.json is:
"@ngtools/webpack": "^6.0.0",
"@angular/router": "^5.2.0",
"webpack": "4.8.3",
"webpack-cli": "2.1.4",
和我的angularCompilerPlugin配置为:
And my angularCompilerPlugin config is:
new AngularCompilerPlugin({
tsConfigPath: 'path-to-tsconfig.webpack.json',
entryModule: 'path-to-app.module#AppModule',
sourceMap: true
}),
通过这些配置,我得到:
With these configurations, I'm getting:
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
请提供任何指导或帮助。
Please any direction or help.
推荐答案
我能够通过添加Lazy来解决此错误文件
部分中指向ts.config-aot.json的模块.ts路径:
I was able to resolve this error by adding the Lazy Module .ts paths to my ts.config-aot.json in the files
section:
{
"compilerOptions": {
"target": "es5", //most browsers currently understand this version of Javascript
"experimentalDecorators": true, //Angular2 uses Component,Injectable etc
"emitDecoratorMetadata": true, //Required for Angular2 to use the metadata in our components
//"sourceMap": true
"types": [
"node",
"jasmine"
],
// "typeRoots": [
// "node_modules/@types"
// ],
"lib": [
"es2015",
"es2015.iterable",
"dom"
]
},
"exclude": [
"node_modules"
],
"files": [
"src/app/app.module.ts",
"src/main.ts",
"src/app.d.ts",
"src/app/sandbox/sandbox.module.ts",
"src/app/supplier-xchange/supplier-xchange.module.ts",
"src/app/company-profile/company-profile.module.ts",
"src/app/bom/bom.module.ts",
"src/app/custom-price-column/custom-price-column.module.ts",
"src/app/neca/neca.module.ts"
]
}
这篇关于_lazy_route_resource惰性名称空间对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文