我有两个工作方式不同的项目,我说不出有什么不同.我有一个项目的以下内容...
// In .ts wile
import 'core-js/es6';
import 'reflect-metadata';
这在一个项目上效果很好,但是,在另一个项目上使用相同的tsconfig.json和打字.json以及我得到的网页配置中配置的ts加载器...
未捕获的SyntaxError:意外的令牌导入
失败的那个上的传输JS看起来像这样...
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {import 'core-js/es6';
import 'reflect-metadata';
I will post the succeeding project one in a bit
所以我的问题是我错过了什么?typescript定义是否未正确导入?我已经试着再次跑typings install
,只是为了排除这种可能性.
More Info
//tsconfig
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
}
}
// Typings.json
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160602141332",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:dt/node#6.0.0+20160621231320"
}
}