Is there an official/recommended way of enabling certain babel transforms only for the UMD build? Specifically, the goal is to make sure that ES6 classes will always be transpiled to function constructors in the UMD version.
We're using microbundle for a library with a plugin ecosystem and currently, the core lib seems to not transpile classes and some plugins do transpile them; we need to ensure it's either one or the other. Currently, we're hacking it with custom browserlistrc settings, but that doesn't work reliably or long-term.
I assume I'll need to hook into @rollup/babel-plugin somehow but not sure how. I've tried BABEL_SHOW_CONFIG_FOR=./src/index.js npm run build to debug the applied babel config, but it's hard to grok. Adding a babelrc to the project wouldn't work since it should only apply to the UMD build, not the others.
The good thing here is we already separated the modern from the standalone builds in our scripts. But there's probably no command line argument for specifying a custom babel config?
Is there an official/recommended way of enabling certain babel transforms only for the UMD build? Specifically, the goal is to make sure that ES6 classes will always be transpiled to function constructors in the UMD version.
We're using microbundle for a library with a plugin ecosystem and currently, the core lib seems to not transpile classes and some plugins do transpile them; we need to ensure it's either one or the other. Currently, we're hacking it with custom
browserlistrc
settings, but that doesn't work reliably or long-term.I assume I'll need to hook into @rollup/babel-plugin somehow but not sure how. I've tried
BABEL_SHOW_CONFIG_FOR=./src/index.js npm run build
to debug the applied babel config, but it's hard to grok. Adding ababelrc
to the project wouldn't work since it should only apply to the UMD build, not the others.The good thing here is we already separated the modern from the standalone builds in our scripts. But there's probably no command line argument for specifying a custom babel config?