Babel preset for Boldr.
babel-plugin-universal-import
and babel-plugin-styled-components
are included and enabled by default. If you don't need them,
they can be disabled by passing universal: false
and/or styled: false
to the preset's options.
const defaults = {
// log output to the console
verbose: false,
// es modules enabled/disabled -- accepts: commonjs, false, umd, etc
modules: false,
// Prefer built-ins over custom code. This mainly benefits for modern engines.
useBuiltIns: true,
// Whether to enable source map output
sourceMaps: true,
// Enable full compression on production scripts or basic compression for libraries or during development.
compression: false,
// Keeping comments to be compatible with Webpack's magic comments
comments: true,
// Do not apply general minification by default
minified: true,
// Env Settings
looseMode: true,
specMode: false,
// transform-runtime
// -- generators
regen: false,
// -- helpers
rtHelpers: false,
// -- require polyfill
polyfill: false,
// fast async
// -- transpile using spec helpers -- no run time required, but slower.
// --- !!! MUST be false if nodentRt is true
faSpecMode: true,
// -- use nodent runtime for async/await - much faster than babel
nodentRt: false,
targets: {
uglify: true,
browsers: 'last 2 versions',
},
exclude: ['transform-regenerator', 'transform-async-to-generator'],
// Lodash Plugin Settings
lodashInc: ['lodash', 'async', 'ramda', 'recompose'],
styled: true,
universal: true,
}
Browser default options:
[
["boldr", {
"verbose": false,
"modules": false,
"useBuiltIns": true,
"targets": { "browsers": "last 2 versions"}
}]
]
Node default options:
[
["boldr", {
"verbose": false,
"modules": false,
"useBuiltIns": true,
"targets": { "node": "current"}
}]
]
Included Presets:
Included Plugins:
fast-async
babel-plugin-syntax-dynamic-import
babel-plugin-syntax-flow
babel-plugin-transform-class-properties
babel-plugin-transform-decorators-legacy
babel-plugin-transform-object-rest-spread
babel-plugin-transform-react-jsx
babel-plugin-transform-flow-strip-types
babel-plugin-dynamic-import-node
Production - React:
babel-plugin-transform-react-constant-elements
babel-plugin-transform-react-inline-elements
babel-plugin-transform-react-remove-prop-types
Development - React: