1.0.0 • Published 3 years ago

babel7config-for-ts v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

babel7config-for-ts

babel7config-for-ts is designed for compiling .ts and '.tsx'. It is based on Babel7 and core-js3.

Installation

babel7config-for-ts needs babel-runtime, so your need to install them before installing babel7config-for-ts.

$ npm install @babel/runtime @babel/runtime-corejs3 core-js regenerator-runtime
$ npx install-peerdeps -D babel7config-for-ts

Usage

To compile .ts, set babel config:

{
  "extends": "babel7config-for-ts"
}

To compile .tsx, set babel config:

{
  "extends": "babel7config-for-ts/tsx"
}

Then in your app entry file, add code like:

import 'core-js/stable'
import 'regenerator-runtime/runtime'

// your ts code here
interface Params {...}