2.7.2 • Published 4 years ago
@chialab/babel-preset v2.7.2
A custom set of plugins, based on the @babel/preset-env
, which includes:
@babel/plugin-proposal-class-properties
Support for class private and public fields@babel/plugin-proposal-decorators
for decorators support@babel/plugin-syntax-dynamic-import
for dynamicimport()
syntax supportbabel-plugin-transform-inline-environment-variables
:process.env
replacementsbabel-plugin-istanbul
: code coverage@babel/plugin-transform-react-jsx
: transpile JSXbabel-plugin-jsx
: auto import JSX pragmababel-plugin-jsx-template
: auto export a function with a JSX templatebabel-plugin-assertions
: polyfill assertion statements with Chaibabel-plugin-transform-commonjs
: try to convert CommonJS modules to ES6 modules
Install
npm install @chialab/babel-preset -D
# or
yarn add @chialab/babel-preset -D
Usage
Add to the .babelrc
file the preset:
{
"presets": [
["@chialab/babel-preset", { ... }]
],
"plugins": [ ... ]
}
Options
The preset inherits all the @babel/preset-env
options, available here.
Name | Accepts | Default | Description |
---|---|---|---|
env | Boolean | true | Should use @babel/preset-env . |
pragma | String | - | The JSX pragma. |
pragmaModule | String | - | The module path which exports the pragma. |
pragmaDefault | Boolean | false | Import pragma as default member. |
assertions | Boolean | false | Polyfill assertion statements with Chai. |
coverage | Boolean | false | Should enable code coverage. |
coverageInclude | Array | [] | A list of files to include in the coverage. |
coverageExclude | Array | [] | A list of files to exclude from the coverage. |
transformCommonjs | Boolean | false | Should convert CommonJS modules. |
transformCommonjsCache | Boolean | false | A Map instance to use as cache for the tranformer. |
2.7.2
4 years ago
2.7.1
4 years ago
2.7.0
5 years ago
2.6.4
5 years ago
2.6.3
5 years ago
2.6.2
5 years ago
2.6.1
5 years ago
2.6.0
5 years ago
2.5.3
5 years ago
2.5.2
5 years ago
2.5.1
5 years ago
2.5.0
5 years ago
2.4.0
5 years ago
2.3.5
5 years ago
2.3.4
5 years ago
2.3.3
5 years ago
2.3.2
5 years ago
2.3.1
5 years ago
2.3.0
5 years ago
2.2.0
5 years ago
2.1.1
5 years ago
2.1.0
5 years ago
2.0.2
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.4.0
5 years ago
1.3.2
6 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.0
6 years ago
1.1.0
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago