@pwa/plugin-typescript
PWA plugin for TypeScript syntax support!
Installing this plugin allows your PWA toolchian to consume & understand TypeScript. This is done by:
- attaching
@babel/preset-typescript - altering webpack so that it recognizes the
.tsand.tsxextensions - altering
@pwa/plugin-prettierand@pwa/plugin-eslinttraverse TypeScript (if installed) - running TypeScript type checks in a separate process
Important: Your PWA application is still compiled by Babel!
This allows you to continue leveraging the existing Babel ecosystem.
This plugin enables you to write in TypeScript and yield its type-checking.
#Install
$ npm install --save-dev @pwa/plugin-typescript typescript
#Usage
None – recognized by and attached to @pwa/core automatically!
#Config
Configurable via the typescript key on your pwa.config.js file.
Your configuration is passsed to @babel/preset-typescript directly!
Note: Prettier options passed to
pwa.config.jsdirectly will override config files' values.
Default Config:
exports.typescript = {
allExtensions: true,
isTSX: true,
}
Available Options:
See the TypeScript Options for the Babel preset.
See also
@pwa/cli(3), @pwa/core(3), @pwa/plugin-brotli(3), @pwa/plugin-buble(3), @pwa/plugin-critters(3), @pwa/plugin-eslint(3), @pwa/plugin-gzip(3), @pwa/plugin-imagemin(3), @pwa/plugin-offline(3), @pwa/plugin-prettier(3)