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

[maybe non issue] recurse into files and minify further #482

Closed
maraisr opened this issue Apr 30, 2022 · 5 comments
Closed

[maybe non issue] recurse into files and minify further #482

maraisr opened this issue Apr 30, 2022 · 5 comments

Comments

@maraisr
Copy link

maraisr commented Apr 30, 2022

Given the html;

<!-- some html here -->
<script type=module>
const my_long_var = 'something not minified';
</script>
<!-- more html here -->

And I run;

minify -vrs build/ -o .

Can the output recurse into that script tag, and minify it as though it was a .js file.

to produce something like;

<!-- some html here (not a comment) -->
<script type=module>var x = 'tiny thingy now';</script>
<!-- more html here (not a comment) -->
@tdewolff
Copy link
Owner

tdewolff commented May 2, 2022

That is because your mimetype for the script is module, which is not automatically understood to be JS. Should now be fixed, thanks for the issue!

@maraisr
Copy link
Author

maraisr commented May 2, 2022

Thank you ever so much for fixing this! <3 and thanks for the lovely util!

@maraisr
Copy link
Author

maraisr commented May 2, 2022

Thanks again, do you think similar to supporting the module type in html files that my-file.mjs files can also be minified?

@tdewolff
Copy link
Owner

tdewolff commented May 2, 2022

Done!

@maraisr
Copy link
Author

maraisr commented May 2, 2022

You're on absolute fire @tdewolff 🚀🚀

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

No branches or pull requests

2 participants