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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI flags to disable HTML/CSS/JS minification individually #7370
Comments
With parcel 2, you can do use this parcelrc to remove all default html optimizers {
"extends": "@parcel/config-default",
"optimizers": { "*.html": [] }
} List of default optimizer plugins: parcel/packages/configs/default/index.json Lines 54 to 61 in b9426b8
|
Fantastic!! Just tested on our application (where HTML minification was causing failures). Works perfectly. Thanks for the lightning-quick response. This issue can be closed. I'll update my comment in question #2651 accordingly. |
Thanks for this, Parcel's HTML minification was also causing noticeable bugs with my relatively small static site. Very worrying because I dread to think how much more damage would have been done if I'd been using it on a larger site. |
I just tried this solution, to leave my index.html unchanged. But it doesn't quite work. Html minification appears to be disabled in the file, but something else is still minimising the JS in the interior of <script> tags in the html file. This prevents the JSON config section of my index.html from being legible or easily hand-edited. |
馃檵 feature request
Add independent CLI flags to disable HTML/CSS/JS minification individually. Example:
--no-optimize-html
--no-optimize-css
--no-optimize-js
The following question contains a workaround, but the workaround is error prone (see my comment for an explanation of why).
#2561
馃敠 Context
Minification sometimes breaks applications in subtle, difficult-to-diagnose ways. Developers do not always have the time or expertise to determine the exact cause of a failure caused by minification, and, therefore, opt to disable minification completely to ensure their application works correctly. However, opting out of ALL minification is often overkill. If CSS or HTML minification causes an application to fail, a developer might want to opt out of the offending minification only, while retaining the benefits of all other minification.
Some developers prefer to keep their CSS or HTML source untouched and human readable, while still minifying JavaScript.
馃捇 Examples
The text was updated successfully, but these errors were encountered: