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

Feature: minify javascript & css #772

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

cornejong
Copy link
Contributor

@cornejong cornejong commented Jun 2, 2024

Feature: minify templ scripts, <script> and <style> tags

added -minify-js flag (explicit opt-in) to the generate command to minify templ scripts & <script> tags.
added -minify-css flag (explicit opt-in) to the generate command to minify <style> tags.

minifier: tdewolff/minify/v2

todo

  • Add minification to generator for templ script components
  • Add -minify-js flag to generator cmd
  • Add minification for script tags in templates
  • Add minification for style tags in templates
  • Tests
  • Docs

@cornejong cornejong marked this pull request as ready for review August 17, 2024 09:19
@cornejong cornejong changed the title Feature: minify javascript Feature: minify javascript & css Aug 17, 2024
@cornejong
Copy link
Contributor Author

cornejong commented Aug 19, 2024

It seems like the CI pipeline regenerates the templates.
generate| + go run ./cmd/templ generate -include-version=false
But in this case we're missing the --minify-js and minify-css flags.
@a-h, got any thought on how to do this? or should we make these explicit opt-outs instead of opt-ins? (--no-minify-js and --no-minify-css)

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

Successfully merging this pull request may close these issues.

1 participant