1.0.0 • Published 5 years ago
babel7config-for-ts v1.0.0
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-tsUsage
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 {...}1.0.0
5 years ago