Skip to content
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

ncc build support #11351

Open
guybedford opened this issue Mar 29, 2020 · 2 comments
Open

ncc build support #11351

guybedford opened this issue Mar 29, 2020 · 2 comments

Comments

@guybedford
Copy link
Contributor

guybedford commented Mar 29, 2020

Feature Request

Zeit uses ncc internally to build a lot of tools into single optimized installs that can be used as standalone executables.

With anything that depends on Babel, this is not currently possible due to the dynamic plugin patterns used internally in Babel, where the plugin name is passed as a string, with the dynamic require itself contained within Babel core.

If plugins are passed instead as require('plugin-name') statements upfront in the preset-env and preset-modules index.js files, then it would be possible to get a full static analysis build of these packages using ncc (and other tools) and create these optimized builds of Babel workflows.

Is this something the Babel core team would consider? If so I would be glad to assist, but wanted to discuss first.

@babel-bot
Copy link
Collaborator

Hey @guybedford! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@nicolo-ribaudo
Copy link
Member

@babel/preset-env and all the other presets in this repository already load plugins upfront: https://github.com/babel/babel/blob/master/packages/babel-preset-env/src/available-plugins.js

For preset-modules, we had a short discussion about it at babel/preset-modules#6, but we could reconsider it if needed. Note that, starting from @babel/preset-env@7.9.0, you don't need @babel/preset-modules anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants