【发布时间】:2016-05-12 14:00:05
【问题描述】:
我正在将我的项目从 Angular2 "2.0.0-beta.17" 迁移到 Angular2 "2.0.0-rc.1"
但是在构建我的项目时出现以下错误:在 cmd 中
多个 polyfill 中的错误
找不到模块:错误:无法解析 模块 'angular2/bundles/angular2-polyfills' 在 C:\Users\akhilesh.kumar\Desktop\ang17
@多重填充
在浏览器控制台中我得到跟随错误
Uncaught Error: Cannot find module "angular2/bundles/angular2-polyfills"
Uncaught reflect-metadata shim is required when using class decorators
Uncaught TypeError: Cannot read property 'isDefaultChangeDetectionStrategy' of undefined
我的 webpack 配置如下
config.entry = isTest ? {} : {
'polyfills': ['es6-shim/es6-shim.js', 'angular2/bundles/angular2-polyfills'],
'vendor': './src/vendor.ts',
'app': './src/bootstrap.ts' // our angular app
};
config.module = {
preLoaders: isTest ? [] : [{test: /\.ts$/, loader: 'tslint'}],
loaders: [......],
postLoaders: [],
noParse: [/.+zone\.js\/dist\/.+/, /.+angular2\/bundles\/.+/, /angular2-polyfills\.js/]
};
【问题讨论】:
标签: typescript angular webpack