问题
错误:webpack:编译失败。
吴版
@angular/cli: 1.1.0
node: 6.11.0
os: win32 x64
@angular/animations: 4.2.6
@angular/common: 4.2.6
@angular/compiler: 4.2.6
@angular/core: 4.2.6
@angular/forms: 4.2.6
@angular/http: 4.2.6
@angular/platform-browser: 4.2.6
@angular/platform-browser-dynamic: 4.2.6
@angular/router: 4.2.6
@angular/cli: 1.1.0
@angular/compiler-cli: 4.2.6
@angular/language-service: 4.2.6节点版本v6.11.0
D:\Angular2DevApp>npm version
{ 'angular2-dev-app': '0.0.0',
npm: '5.2.0',
ares: '1.10.1-DEV',
http_parser: '2.7.0',
icu: '58.2',
modules: '48',
node: '6.11.0',
openssl: '1.0.2k',
uv: '1.11.0',
v8: '5.1.281.102',
zlib: '1.2.11' }错误图像:


发布于 2017-07-13 08:29:07
尝试如下:在webpack配置中,添加以下插件和加载程序:
import {AotPlugin} from '@ngtools/webpack'
exports = { /* ... */
module: {
rules: [
{
test: /\.ts$/,
loader: '@ngtools/webpack',
}
]
},
plugins: [
new AotPlugin({
tsConfigPath: 'path/to/tsconfig.json',
entryModule: 'path/to/app.module#AppModule'
})
]
}加载程序使用webpack插件编译您的TypeScript。重要的是将两者都包括在内,而不包括任何其他TypeScript编译器加载程序。
https://stackoverflow.com/questions/45074266
复制相似问题