plugin-build-node: need a way to configure babel compilation #25
Comments
Hi @taras, thanks for your patience. You should be able to configure the Babel compilation with a normal top-level Does that help answer your question? tl;dr: A top-level |
Hi @FredKSchott, thank you for taking the time to get back to me. If I understand correctly, the idea is that In my situation, I want to configure the build to be slightly different for Node than browser or ES builds. Our current build process uses Rollup directly and we specify based on build target how we want it to build the dist files. We make an assumption that our CJS builds will be used in Node where We find ourselves doing this kind of fuckery because Babel doesn't support extending native classes which leads to transpiling all classes or none at all. How can I customize babel transpilation for Node differently than other distributions? |
Hahaha fair enough, thanks for clarifying. Check out the “minNodeVersion” in the plugin README. Could that fit your need here? Although class syntax is supported all the way back to Node.v6, so im surprised to hear that this is happening. Are you seeing classes getting compiled out in your build output? |
You are correct in that Node should not be transpiling How do I get |
Currently, there is no way to configure how Babel compiles source which makes it impossible to add plugins like @babel/plugin-proposal-class-properties or change how
@babel/preset-env
compiles the source.As a library maintainer, I need a way to configure the compilation for my project. If you're open to changing this, I can create a PR to add this functionality.
The text was updated successfully, but these errors were encountered: