Provide the option to override parser plugins in configuration #611
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.
Related to #571
This PR provides a new configuration key
parserPlugins
that allows the end-user to override or extend what babel parser plugins to use. See README for example use.This implementation uses a (nasty) singleton in parse.js to achieve the goal. While I'm not too happy about that, I have reasons;
I spent a long time trying to implement this by passing the values around from Configuration.js to its endpoint, parse.js. However, I ran into trouble doing so. As it turns out a lot of code is calling parse.js indirectly, such as
findExports
and evenmeteorEnvironment
andConfiguration
itself. I tried to find all the cases but in the end I had hundreds of lines of code changed and 96 failed tests. Weird circular dependencies started showing up as well. In the end, I gave up on that strategy.