How to provide the module flag in a VS2015 project?

前端 未结 3 1453
野趣味
野趣味 2020-12-16 18:44

I\'ve created a new .ts file in a webproject using VS2015. In the properties for the project under TypeScript Build I\'ve checked Module System = AMD.

Then when tryi

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-16 19:41

    I couldn't make it work. Whatever I change in typescript section - it's ignored on build.

    If I set verbosity to Detailed in Tools->Options->Build and run I can see that all my settings are ignored, including -module flag.

    Just as workaround. Create a tsconfig.json file in root directory. And add in pre-build events "tsc" command. In this case it worked just fine.

    {
      "compilerOptions": {
        "module": "commonjs",
        "noImplicitAny": true,
        "removeComments": true,
        "preserveConstEnums": true,
        "sourceMap": true
      }
    }
    

提交回复
热议问题