简体   繁体   English

带有--module选项的Sublime Text中的Typescript构建系统配置

[英]Typescript Build System Config in Sublime Text with --module option

I tried with these build system configs but I wanna add the '--module commonjs' option to the compiler. 我尝试使用这些构建系统配置,但想将'--module commonjs'选项添加到编译器中。

I tried this, but it doesn't work. 我试过了,但是没有用。

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

error TS5023: Unknown compiler option 'module commonjs'. 错误TS5023:未知的编译器选项'module commonjs'。 I got this error. 我得到这个错误。 it's like is not recognizing the '--' characters 就像是无法识别'-'字符

Thanks in advance. 提前致谢。

You where pretty close! 你那里很近! If you change --module commonjs to separate items it works correctly, see below. 如果将--module commonjs更改为单独的项目,则它可以正常工作,请参见下文。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM