New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using babel compilation and .babelrc in local Meteor packages #10459
Comments
Putting a The other question is where to install the Babel plugin packages themselves. I think the best place to do that is in the top-level application If the setup I've described doesn't work for some reason, that's a bug that we should fix. |
By the way, the problem described by the question you linked to seems to be related to enabling new syntax in the Babel parser, rather than finding the I'd be happy to take a look at a reproduction, if you have time to put one together. |
Ok, here is a reproduction: |
@benjamn: Did you end up taking a look at the reproduction? |
I just had a look and adding the plugins to the root app didn't seem to do anything. What did work was adding an
This compiles and doesn't ship the babel code to the client, but does mean you need a copy of babel and the plug-ins installed for each package that uses this |
It would be super nice if there was a way to do this without Npm.depends in each Meteor package because this copies the NPM modules into every Meteor package that uses it (within the .npm folder), and takes longer to build (installing the same NPM package many times). In our project, we tried to make it use a global version of "@babel/plugin-proposal-optional-chaining" within our project (with package.json), but for some reason it won't work. Ideally we would create a meteor package, that when included in another package using api.use, would automatically enable these various Babel NPM plugins, and use api.imply('ecmascript') as well so it's just 1 line of code to enable. We haven't found a way to do it yet. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still relevant |
One thing I will say is that the built-in optional chaining for Meteor 1.8.2 is awesome! I think they should promote it more because it's a big deal. |
I didn't even realise it was built in! I wonder if that also provides backwards-compat with packages that start using it? |
@coagmano Yep, that's the beauty of Meteor compiling package and application code at application build time, using the current/latest version of Note, however, that compiler plugins are built at Also, since |
@benjamn This is pretty awesome. I think the Meteor team should put it a bit more prominently that optional chaining works now in 1.8.2. We were pleasantly surprised when we updated :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi guys, still relevant, there seems to be a fix with NPM.depends, but then why don't we have an error message when dependencies are missing? I would expect the build to fail or something when the dependencies aren't there. Edit: the NPM.depends doesn't really seem to fix it to me and it's not obvious to debug, I have absolutely no debug message and didn't found any option to make Babel build more verbose :/ |
I am working on an Open Source forum platform (Github), and our setup is such that almost all of my code lives in the
packages
directory, and is spread over a few different folders (I am using the Vulcan framework, which came with this architectural choice).I would really like to use the Babel optional chaining plugin, but have been unable to get babel compilation to work for any of the code that lives in my
/packages
directory. I've added a.babelrc
file in the top-level, as well as in the/packages
folder, and also in the folders of the individual packages, without any success. I've also played around with adding thebabel-compiler
plugin as a dependency.I considered asking about this on StackExchange first, but discovered this question, which seems to be basically the same problem I have, and which didn't get an answer, but only a suggestion to ask the question on Github instead, so I figured I would ask it here.
The text was updated successfully, but these errors were encountered: