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

Banner #116

Closed
thiamsantos opened this issue Apr 12, 2018 · 8 comments
Closed

Banner #116

thiamsantos opened this issue Apr 12, 2018 · 8 comments
Labels

Comments

@thiamsantos
Copy link

Would be great to add option to prepend a banner on the bundle, maybe using rollup-plugin-license on something similar.

@thiamsantos thiamsantos mentioned this issue May 19, 2018
@ForsakenHarmony
Copy link
Collaborator

Can I ask why you'd need this?

@thiamsantos
Copy link
Author

I usually don't use this feature. But, some library authors like to use it. I think that may be useful to make easy the migration from others tools to microbundle, not requiring to stop using a banner to do the migration.

@developit
Copy link
Owner

Problem would be that it conflates the filesize. I think if we do this and the resulting banner'd file is measured for size, we should strip the comment when calculating.

@ForsakenHarmony
Copy link
Collaborator

I think we should remove minification in the bundle by default anyways

maybe run uglify in memory

@Andarist
Copy link
Collaborator

@ForsakenHarmony 👍 minification makes it harder to debug minified dependencies. Most common use case is to uglify with a bundler later - when building application. IMHO the only format that could be minified by default is UMD.

Minifying "in memory" just to report size is IMHO also a good idea.

I hope to prepare a PR for this (& more) soon-ish, planning to do it for so long already :s just not having enough time lately.

@developit
Copy link
Owner

developit commented May 31, 2018

It seems a shame to minify in-memory just to report size though. Why not write the files to disk as .min.js? That way the library author can choose when they are specifying their package.json main fields.

FWIW I 100% need minification for some of my use-cases for Microbundle. I guess it would be fine if --compress became a flag, but I need it to still exist. The uglify property configuration thing is how tiny libraries stay tiny 💘

@ForsakenHarmony
Copy link
Collaborator

It's already a flag, but I think off would be the better default but we'd still want the size Output

@developit
Copy link
Owner

tbh that depends whether you're using microbundle for web or node. we have the --target option, so we already know the answer in most cases. I use it a lot more for web, where optimize should be on by default.

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

No branches or pull requests

4 participants