Babel
Install
sh
.babelrc
js
Using Command Line Interface
sh
package.json
js
Execute Babel from the command line
sh
Browserify
Install
sh
Using Command Line Interface
sh
Using API
js
More details: smrq/tsify
Grunt
Using grunt-ts (no longer maintained)
Install
sh
Basic Gruntfile.js
js
More details: TypeStrong/grunt-ts
Using grunt-browserify combined with tsify
Install
sh
Basic Gruntfile.js
js
More details: jmreidy/grunt-browserify, TypeStrong/tsify
Gulp
Install
sh
Basic gulpfile.js
js
More details: ivogabe/gulp-typescript
Jspm
Install
sh
Note: Currently TypeScript support in jspm is in 0.16beta
More details: TypeScriptSamples/jspm
MSBuild
Update project file to include locally installed Microsoft.TypeScript.Default.props (at the top) and Microsoft.TypeScript.targets (at the bottom) files:
xml
More details about defining MSBuild compiler options: Setting Compiler Options in MSBuild projects
NuGet
- Right-Click -> Manage NuGet Packages
- Search for Microsoft.TypeScript.MSBuild
- Hit Install
- When install is complete, rebuild!
More details can be found at Package Manager Dialog and using nightly builds with NuGet
Rollup
Install
Note that both typescript and tslib are peer dependencies of this plugin that need to be installed separately.
Usage
Create a rollup.config.js configuration file and import the plugin:
js
Svelte Compiler
Install
Note that typescript is an optional peer dependencies of this plugin and needs to be installed separately. tslib is not provided either.
You may also consider svelte-check for CLI type checking.
Usage
Create a svelte.config.js configuration file and import the plugin:
js
You can now specify that script blocks are written in TypeScript:
Vite
Vite supports importing .ts files out-of-the-box. It only performs transpilation and not type checking. It also requires that some compilerOptions have certain values. See the Vite docs for more details.
Webpack
Install
sh
Basic webpack.config.js when using Webpack 5 or 4
js
See more details on ts-loader here.
Alternatives: