-
Notifications
You must be signed in to change notification settings - Fork 6
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
Is it necessary to transform (via babel) and minify packaged code? #1642
Comments
@askoufis Thanks a lot for the detailed feedbacks! I agree with your points on minifier. The downside though is it increases the cost to import this library via modern javascript module, e.g. For I am awared that we are not using any features that is outside of targeted nodejs version range |
I hadn't considered the case where you're loading this package via a script element. However, currently this wouldn't work out of the box because the bundled file still contains imports for its dependencies, so the user would need to use import maps to resolve those. You could bundle this package's dependencies if you really wanted to cater to that use case. I'd be happy to keep the minified bundle, but it could instead be distributed alongside the regular, non-minified files, and consumers could include it in their HTML via a CDN like unpkg. |
I came here for this too. You could provide a .min.js variation. Inspecting the source at a glance on npm is handy to know if a package is malicious. Seeing it minified raised flags. |
It makes sense, I didn't consider this before.
All valid, I may do that when js module is requested in the future. Considering all that, I have removed the minification on version |
Thank you @foray1010! |
I've noticed that this package runs babel over its packaged code, as well as minifying it with terser.
didyoumean2/rollup.config.ts
Lines 36 to 46 in 14d55cb
I think both of these steps are unnecessary and should be removed from the build pipeline for 2 reasons:
@babel/runtime
, inpackage.json
. Again, if a consumer wants to utilize this package in combination with@babel/plugin-transform-runtime
, then that should be up to them. Furthermore,@babel/runtime
doesn't actually end up used in the final packaged files, so it's not even really required for this package.Happy to discuss this further if necessary, though I don't think this is too controversial of an idea. If it's agreed that this change is worthwhile, then I'd be happy to contribute the necessary changes.
The text was updated successfully, but these errors were encountered: