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 even meteorEnvironment and Configuration 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.
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.