Open
Description
It took me a while to find out how to create a custom babel-preset, where I can pass options to it. It would be good if you can add an example to the documentation, in a way like this:
// babel-preset-myPreset on npm
module.exports = (api, opts) => {
return {
plugins: [
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining"
],
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "entry",
...(opts && opts)
}
]
]
}
}
call in webpack configuration
// webpack configuratoin
{
loader: 'babel-loader',
options: {
presets: [
[
'babel-preset-myPreset', {
targets: {
esmodules: true
}
}
]
]
}
}
Metadata
Metadata
Assignees
Labels
No labels