【发布时间】:2017-09-29 20:07:05
【问题描述】:
我有一个带有tsconfig.json 的打字稿项目
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"inlineSources": true,
"lib": [
"es6",
"dom"
],
"types": [
"node"
],
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}
我正在运行一个脚本"test:integration": "./node_modules/typescript/bin/tsc && mocha test/integration/** --recursive"
然后我看到了:
/Users/mm81509/projects/coverpath-producer-management/test/integration /Example.js.map:1
(function (exports, require, module, __filename, __dirname) { {"version":3,"file":"Example.js","sourceRoot":"","sources":["Example.ts"],"names":[],"mappings":"","sourcesContent":[""]}
^
SyntaxError: Unexpected token :
...
什么会导致 typescript 编译器在 map.js 中产生语法错误?我只在项目的那个文件中看到这个错误。
【问题讨论】:
标签: javascript typescript mocha.js tsconfig