How to stop visual studio generate typescript js and js.map files while publishing

4.4k views Asked by At

I set up my project that combine javascript output into file to $(ProjectDir)dist\output.js and uncheck generate source maps.

Tools -> Options -> Text Editor -> Typescript -> Project -> Automatically compile Typescript files which are not part of a project is unchecked as well.

While building and running project from visual studio, it works as expected: generate only output.js files.

However while publishing my project, it still generates js and js.map file foreach .ts files.

When I check myproject.pubxml.user file, it says:

<File Include="app/app.module.js">
  <publishTime>06/16/2015 17:41:13</publishTime>
</File>
<File Include="app/app.module.js.map">
  <publishTime>06/16/2015 17:41:13</publishTime>
</File>
<File Include="app/app.routes.js">
  <publishTime>06/16/2015 17:41:13</publishTime>
</File>
<File Include="app/app.routes.js.map">
  <publishTime>06/16/2015 17:41:13</publishTime>
</File>
<File Include="app/controllers/account/loginController.js">
  <publishTime>06/16/2015 17:41:13</publishTime>
</File>

How can I stop Visual Studio from generating those unwanted .js and map.js files?

1

There are 1 answers

1
basarat On BEST ANSWER

However while publishing my project, it still generates js and js.map file foreach .ts files.

You probably have different config for debug and release. Make them the same.