I have a group of typescript files in my solution and I am compiling these to JS using typescript features directly within Visual Studio 2017. I am using tsconfig.json file.
I am able to bundle the output JS files in either VS or tsconfig.
I am able to use WebEssentials to minify and map *bundle.js.min back to *.bundle.js
What is the correct sequence for compiling, bundling, minifying and mapping within VS2017?
- project.csproj
- scripts //output files
- my.bundle.js
- my.bundle.min.js
- my.bundle.min.js.map
- src //input files
- mytypes.ts
- mylogic.ts
- mybaselogic.ts
(NOTE: I don't want to add the burden of WebPack, Babel or Grunt to my solution)
The good news is you can get very far with the limited toolset of Typescript and Web Essentials.
The key step is to create a
tsconfig.jsonin yoursrcdirectory:and add a NuGet package to
Typescript. This will alter your project automatically to automatically recreatebundle.json each build.You are now able to import the bundled javascript files using an AMD loader like
almond.js: