babel-preset-platform
v1.0.0-alpha.2
Published
Set platform-specific options in babel configs
Downloads
6
Maintainers
Readme
babel-preset-platform
Set platform-specific options in babel configs
Usage
target
BABEL_PLATFORM=node babel ...
BABEL_PLATFORM=browser webpack ...
.babelrc
{
presets: [
['platform', {
browser: {
// browser-only presets
presets: [
['env', {
targets: { browsers: 'last 2 versions' }
}]
]
},
node: {
// node-only presets
presets: [
['env', {
targets: { node: 'current' }
}]
],
// node-only plugins
plugins: ['dynamic-import-node']
},
'*': {
// common presets
presets: [
// shared options for env preset
['env', {
enabled: ['transform-classes']
}]
]
}
}]
...
],
plugins: [
...
]
}