@considonet/babel-preset-typescript

1.1.1 • Public • Published

@considonet/babel-preset-typescript

Configurable TypeScript preset for Babel 7.x supporting Vue.js TS SFC, React, JS and TypeScript

What is this?

This preset was created as a part of G-Build evolution. Starting from version 4.0, there are no longer configuration files for Babel and these have to be provided manually (as they are project-specific). Because all our existing legacy projects have exactly the same config, this package makes the transition to G-Build 4 and Babel TypeScript transpilation easy. Also it provides a setup which was proven to work for us.

This preset loads the following presets and plugins:

Options

  • vue (boolean, default: false) - enables TS Vue SFCs transpilation. Because the check is a potentially expensive operation, it is disabled by default. Once enabled, it replaces @babel/preset-typescript with our own babel-preset-typescript-vue

  • react (boolean, default: true) - enables @babel/preset-react

  • presetEnvSettings (object, default: see below) - configures @babel/preset-env.

Parameter is optional. The default setup is as follows:

{
  "modules": "auto",
  "useBuiltIns": "usage",
  "corejs": 3
}

Please refer to @babel/preset-env docs for more details.

  • presetReactSettings (object, default: see below) - configures @babel/preset-react if react set to true.

Parameter is optional. The default setup is the preset's default setup.

Please refer to @babel/preset-react docs for more details. It's a good place to set runtime to automatic if you're already using React 17.

Install

Using npm:

npm install --save-dev @considonet/babel-preset-typescript

or using yarn:

yarn add @considonet/babel-preset-typescript --dev

Package Sidebar

Install

npm i @considonet/babel-preset-typescript

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

13.9 kB

Total Files

8

Last publish

Collaborators

  • pawelgabryelewicz