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

bundler: implement --legal-comments to control how licenses in source code is bundled. #8727

Open
muuvmuuv opened this issue Feb 6, 2024 · 3 comments
Labels
bundler Something to do with the bundler enhancement New feature or request

Comments

@muuvmuuv
Copy link

muuvmuuv commented Feb 6, 2024

What is the problem this feature would solve?

To minify the bundle (w/o --compile) it would be great to have the licence exported to another file or to be removed completely. Also some JS is still unminified.

What is the feature you are proposing to solve the problem?

Minify compiled bundle more.

What alternatives have you considered?

Manually sed it out or with esbuild like explained below.

@muuvmuuv muuvmuuv added the enhancement New feature or request label Feb 6, 2024
@Electroid
Copy link
Contributor

Out of curiosity, is this something you can do in esbuild?

@Electroid Electroid added the bundler Something to do with the bundler label Feb 6, 2024
@muuvmuuv
Copy link
Author

muuvmuuv commented Feb 6, 2024

Valid point. Yes. Still it would have comments left, and some JS is not minified but just by using --compile.

bun esbuild src/main.ts --bundle --outfile=server-minified --platform=node --format=esm --minify --legal-comments=none
bun bun ./server-minified --compile --outfile=server

image

@muuvmuuv muuvmuuv changed the title Minify remove/export licences Compile: Minify any js and remove licences in outfile Feb 6, 2024
@paperdave paperdave changed the title Compile: Minify any js and remove licences in outfile bundler: implement --legal-comments to control how licenses in source code is bundled. Feb 6, 2024
@paperdave
Copy link
Collaborator

many places in the current code have markers for this.

image

most of the work for this would be to just copy esbuild's implementation and port into zig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bundler Something to do with the bundler enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants