babel-preset-o
v0.4.3
Published
tiny and flexible babel preset
Downloads
154
Readme
babel-preset-o
tiny and flexible babel preset
cover basic usage for react development
Usage
npm i -D babel-preset-o
babel.config.js
module.exports = {
presets: ['babel-preset-o']
}
Options
Use this preset with customized options to extend flexibility of compilation.
targets
Default is undefined
. Ref to babel-preset-env#targets
modules
Default is false
, ref to babel-preset-env#modules
useBuiltIns
Default is false
, ref to babel-preset-env#usebuiltins
runtime
Default is 'classic'
, Ref to babel-preset-react#runtime
Example
transform code to commonjs
// babel.config.js
module.exports = {
presets: [
['babel-preset-o', { modules: 'commonjs' }]
]
}
transform all code to es5
// babel.config.js
module.exports = {
presets: [
['babel-preset-o', { targets: {} }]
]
}