-
Notifications
You must be signed in to change notification settings - Fork 200
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
jsnext:main / module build #25
Comments
Hmm, so I very strongly disagree about this: ES Modules is part of ES2015. It doesn't make much sense to support only the module semantics of that spec but nothing else. People should be traveling spiking node_modules, or transpiling their whole bundle as a step like you would use Uglify. That said, if it's an issue I think we should just remove the modules / jsnext entry - there are no compile time optimizations that will affect unfetch, since it exports a single function. |
That's the reason why I discovered this. I added I read a lot out there about The whole ecosystem is a little bit torn and confused about this whole stuff (for instance the whole |
Agreed about mismatched transpile assumptions, and you're right this isn't a polar issue - sorry if my reply seemed a little quick on the draw there haha. I'm fine if there's a nice way to output |
are u using the webpack.uglify or? i dont believe it not work with es6, if it is true... damn webpack uglysystem. it is true, Jason, that it not make sense to just let the esmodules syntax and transpile evrything other. these fields are meant to be in es2015 syntax and above, no matter what feature. |
Yes I am using the webpack built in UglifyJS. Uglify does not work with 2015. You can reproduce it very easy: Create a file foo.js:
Run UglifyJS: ❯ uglifyjs foo.js
Parse error at foo.js:1,13
SyntaxError: Unexpected token: Also there is a big issue about tree shaking and UglifyJS in webpack: webpack/webpack#2867 and one in UglifyJS regarding harmony mishoo/UglifyJS#448
That's not really true as I said before. Imagine you write a really large application with a lot of dependencies and all that dependencies are not "ready to use" transpiled. You would end up in a build system for your application that would be hell to configure and maintain (you have to look in every single dependency what language features it use). Not to mention the horrible build time. If you are interested you can read about it here jsforum/jsforum#5 @developit thank you for the very quick |
@screendriver I maintain such an application as my day job, 30+ repos of ES2015. We transpile everything and it works great. |
You the hell don't need to know what your deps use. 🚀 In anyway all hippie funky guys nowadays use 50+ devDeps with dozens of Babel-ish presets and shits. Not to mention that the install time is awful even with 1Gb network ; ). So I don't see any problems. |
At the moment
jsnext:main
respectivelymodule
points tosrc/index.js
. This leads to the situation where the consuming package / application needs to transpileunfetch
as well in their build because older browsers don't understand arrow functions and so on.jsnext:main
ormodule
code should always already be transpiled. The only difference is that they use ES6 module syntax instead of commonjs function calls.See also webpack/webpack#2902 (comment) and pkg.module in rollup☺️
The text was updated successfully, but these errors were encountered: