-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add browserify in package.json for ES6 #1653
Comments
It seems a bit odd to have to configure browserify here for your project. Shouldn't this type of config go in your project's bundler config? |
I hear you. Although some other modules do that so it's not unusual. And ultimately we all have to transpile to ES5. This is one solution to flag that package is ES6 and needs transpilation. Don't want to tell browserify to babelify all node modules which would slow down build enormously. |
I'm glad this fixed someone's workflow, but it broke mine 😄. We run browserify but target Node.js (browserify is useful to generate single JS files). This change means we now get a In general, I think this change means that anyone running browserify over |
Broke ours too. If you need to babelify a particular node module can't it be configured in your project? Not everyone transpiles to ES5. cc @aearly |
I'm considering removing the browserify-specific config. I didn't like doing it in the first place. |
What are you thinking? Why do I need to add "babelify" "@babel/core" and "@babel/preset-env" to my project. I do not want to use babel. I just want to bundle my dependencies. Even if I would use a transpiler, this whole concept does not work with devDependencies. Why should every library provide its own rollup/webpack/browserify config and then require downstream to include their dev dependencies manually? Also now that I am doing that, I am not able to change the configuration. For example how am I supposed to manage polyfills (regenerator-runtime in this case), if I cannot even change the @babel/preset-env configuration (for example to "usage"), or the target? This is madness. I will just stick with v2. Thanks. Babelify my ass. (humour) A more resonable approach would be to target a specific node version, and if you want to use newer features in your source, then transpile it yourself prior to publishing to npm, or just leave them in and leave it to downstream how they want to transpile it for their environment as necessary. This approach (sorry if I repeat mysdelf) is complete nonsense. |
Now that with v3.x my app is breaking since it's browserify + babelify configuration doesn't transform node_modules by default.
See https://github.com/babel/babelify#faq for background.
Suggestion is to add this in your package.json
This will ensure that any app using async and building it with browserify + babelify gets transpiled correctly.
Thanks!
The text was updated successfully, but these errors were encountered: