0.5.0 • Published 4 years ago

@pwa/plugin-typescript v0.5.0

Weekly downloads
1
License
-
Repository
-
Last release
4 years ago

@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 .ts and .tsx extensions
  • altering @pwa/plugin-prettier and @pwa/plugin-eslint traverse 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.js directly will override config files' values.

Default Config:

exports.typescript = {
  allExtensions: true,
  isTSX: true,
}

Available Options:

See the TypeScript Options for the Babel preset.