Socket
Book a DemoInstallSign in
Socket

@pwa/plugin-typescript

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pwa/plugin-typescript

> [`PWA`](https://pwa.cafe/) plugin for [TypeScript](https://typescriptlang.org) **syntax** support!

latest
npmnpm
Version
0.5.0
Version published
Maintainers
2
Created
Source

@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.

FAQs

Package last updated on 01 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts