preactjs / compressed-size-action

GitHub Action that adds compressed size changes to your PRs.
https://github.com/marketplace/actions/compressed-size-action
MIT License
602 stars 84 forks source link

Comments are not stripped from compressed files #39

Closed necolas closed 1 month ago

necolas commented 4 years ago

JavaScript comments are not removed from the built files and contribute to reported file size. I think comments should be stripped to provide realistic data that reflects what a production build would do.

necolas commented 4 years ago

I opened an issue against the size-plugin-core module as it looks like that is where the feature is missing - https://github.com/kuldeepkeshwar/size-plugin-core/issues/8

developit commented 3 years ago

This would likely have to be an option that is disabled by default, since it requires parsing the JS. That'll be slow, right now file files aren't even loaded into memory.

necolas commented 3 years ago

FWIW I use a fork of this action with a fork of the size plugin - https://github.com/necolas/compressed-size-plugin/commit/082eb2c4cb56548aedfa6e967aa52507e569ccad

rschristian commented 1 month ago

Closing, as the better solution here would be to feed the intended output into this action. If you production builds strip comments, then do that and provide the result to compressed-size here.