我在尝试编译打字稿文件时收到以下错误。这是第一次玩打字稿这么老实说我不知道我做错了什么......
Running "ts:default" (ts) task
Compiling...
### Fast Compile >>src/FileProcessor.ts
Using tsc v1.8.10
src/FileProcessor.ts(1,21): error TS1005: ';' expected.
我正在使用" grunt-ts"使用以下grunt任务...
ts: {
default: {
src: ['src/**/*.ts'],
outDir: 'lib/',
options: {
module: 'commonjs'
}
}
},
下面是我的打字稿文件
import path = module('path');
console.log(path.join('test', 'test2'));
答案 0 :(得分:0)
切换
import path = module('path');
到
import path = require('path');