node.js - 使用 --module 选项在 Sublime Text 中使用 Typescript 构建系统配置

标签 node.js sublimetext2 typescript

我尝试过 these build system configs但我想向编译器添加“--module commonjs”选项。

我尝试过这个,但不起作用。

{
    "selector": "source.ts",
    "cmd": ["tsc.cmd","--module commonjs","$file"],
    "file_regex": "^(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$"
}

错误 TS5023:未知的编译器选项“module commonjs”。我收到这个错误。就像无法识别“--”字符

提前致谢。

最佳答案

你离得很近了!如果您更改 --module commonjs 来分隔项目,则它可以正常工作,请参见下文。

"cmd": ["tsc.cmd","--module", "commonjs","$file"],

关于node.js - 使用 --module 选项在 Sublime Text 中使用 Typescript 构建系统配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26679022/

相关文章:

selection - 在 Sublime Text 2 中交换文本选择

angular - 错误 : Template parse errors: Can't bind to 'myProperty' since it isn't a known property of 'myComponent'

javascript - 上传和读取文件客户端, Angular 2

node.js - 获取错误 "Unexpected token <"304 notmodified withexpress for vue.js 库

sublimetext2 - Sublime Text 模糊文件搜索编号

node.js - 使用 Node.js 通过 Raspberry Pi 3 model B 进行 GPIO

sublimetext2 - SublimeText 不断插入\xc2 字符

reactjs - 如何摆脱我的 "@types/react/index"只能在 React/TypeScript 中使用 'esModuleInterp' 标志 Lint 默认导入

linux - 带 Node 的sudo密码

node.js - Node Express RESTful API默认引擎用于错误处理