Currently, I am working on an older asp.net 4.0 Webforms
project using Visual Studio 2015.
My goal is to transition from using Javascript to TypeScript for certain client side code tasks. While I have experience using TypeScript in projects outside of Visual Studio (such as with Visual Studio Code and node tools like npm and gulp), I am facing some confusion when trying to integrate TypeScript into Visual Studio.
After adding a TypeScript file to my Visual Studio project and installing the TypeScript extension (version 2), I noticed that the generated .js and .map files are in CommonJS
format. This requires me to either load these files or convert them through some bundling process.
I have encountered conflicting information on how to properly configure TypeScript in Visual Studio, including whether a tsconfig.json
file is necessary. In past non asp.net projects, I utilized gulp
along with plugins like gulp-typescript
and browserify
for bundling JS files.
Should I follow the same approach in my asp.net project, or is there a different method for bundling and converting JS files for browser compatibility? If I opt for the gulp method, does this mean I will no longer require the TypeScript compiler installed via the Visual Studio plugin?
Any guidance or suggestions would be greatly appreciated!