OCD*_*Dev 41 typescript phaser-framework visual-studio-code
在VSCode中构建typescript时,我收到以下错误:
错误TS6082:在--out旁边只支持'amd'和'system'模块.
我的设置如下:
tsconfig.json
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"out": "current/game.js",
"removeComments": true,
"sourceMap": false
}
}
Run Code Online (Sandbox Code Playgroud)
.vscode/tasks.json:
{
"version": "0.1.0",
// The command is tsc. Assumes that tsc has been installed using npm install -g typescript
"command": "tsc",
// The command is a shell script
"isShellCommand": true,
// Show the output window only if unrecognized errors occur.
"showOutput": "silent",
// args is the HelloWorld program to compile.
"args": [],
// use the standard tsc problem matcher to find compile problems
// in the output.
"problemMatcher": "$tsc"
}
Run Code Online (Sandbox Code Playgroud)
尽管有错误,game.js文件确实已创建并正常运行.
任何人对可能导致此错误的原因有任何疑问?
C S*_*ver 35
它意味着它所说的.您不能使用--out/ --outFile将模块捆绑在一起用于Node.js/CommonJS,因为CommonJS没有捆绑包格式.只需不要为CommonJS使用该选项,并为每个输入TS模块文件发出相应的JS文件.
| 归档时间: |
|
| 查看次数: |
21503 次 |
| 最近记录: |