Repository navigation
feat(babel): add configFile option - #156
Open
NullVoxPopuli wants to merge 1 commit into
Open
NullVoxPopuli wants to merge 1 commit into
NullVoxPopuli wants to merge 1 commit into
Conversation
Lets the plugin load a Babel config file by path. With `parallel`, each worker loads the file itself, so the config can hold plugins and presets that are functions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
configFileoption, soparallelworks with Babel configs that contain functions.Why
parallel(#139) sends the Babel options to each worker, so plugins must be referenced by name.Many real configs can't do that.
For example, Ember apps build plugin objects and template transforms from functions at config time.
A config file path is just a string.
Each worker passes it to Babel, and Babel loads the file inside that worker.
@rollup/plugin-babel'sparallelrelies on the same approach.Changes
transformWithBabelforwardsconfigFileinstead of always passingfalse.babelrcstaysfalse.applyToEnvironmentno longer disables the plugin when the config file is the only source of plugins.configFileis set, the transform filter skips the Rolldown preset filters, the same as whenpluginsis set. The file can apply to any module.Alternatives explored
plugins.Tests
parallel: 2. The fixture config imports a plugin function.pluginsmerge on top of the config file.configFile, the plugin still runs. This test fails without theapplyToEnvironmentchange.configFile,babel.config.*incwdis still ignored.configFilefalls back to the base filter.🤖 Generated with Claude Code