-
Notifications
You must be signed in to change notification settings - Fork 30
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
[Bug]: Minifying CSS deletes blocks of code #180
Comments
chrisstaite-menlo
added a commit
to chrisstaite-menlo/html-minifier-terser
that referenced
this issue
Aug 19, 2024
If there are multiple ignored CSS blocks within a single clean-css warning message, only the first is replaced with the ignore code. This means that some ingored blocks are simply deleted from the output. The problem is simply that the RegExp is only applied once, despite having the global flag set on it. This is fixed by calling `exec` on the RegExp until it yields no further matches. Added a test for this error case. Fixes terser#180
chrisstaite-menlo
added a commit
to chrisstaite-menlo/html-minifier-terser
that referenced
this issue
Aug 19, 2024
If there are multiple ignored CSS blocks within a single clean-css warning message, only the first is replaced with the ignore code. This means that some ingored blocks are simply deleted from the output. The problem is simply that the RegExp is only applied once, despite having the global flag set on it. This is fixed by calling `exec` on the RegExp until it yields no further matches. Added a test for this error case. Fixes terser#180
chrisstaite-menlo
added a commit
to chrisstaite-menlo/html-minifier-terser
that referenced
this issue
Aug 21, 2024
If there are multiple ignored CSS blocks within a single clean-css warning message, only the first is replaced with the ignore code. This means that some ingored blocks are simply deleted from the output. The problem is simply that the RegExp is only applied once, despite having the global flag set on it. This is fixed by calling `exec` on the RegExp until it yields no further matches. Added a test for this error case. Fixes terser#180
chrisstaite-menlo
added a commit
to chrisstaite-menlo/html-minifier-terser
that referenced
this issue
Aug 21, 2024
If there are multiple ignored CSS blocks within a single clean-css warning message, only the first is replaced with the ignore code. This means that some ingored blocks are simply deleted from the output. The problem is simply that the RegExp is only applied once, despite having the global flag set on it. This is fixed by calling `exec` on the RegExp until it yields no further matches. Added a test for this error case. Fixes terser#180
Yes indeed, I'm seeing issues too since I'm not certain our issues are identical, but I suspect they come from the same source since disabling |
chrisstaite-menlo
added a commit
to chrisstaite-menlo/html-minifier-terser
that referenced
this issue
Aug 27, 2024
If there are multiple ignored CSS blocks within a single clean-css warning message, only the first is replaced with the ignore code. This means that some ingored blocks are simply deleted from the output. The problem is simply that the RegExp is only applied once, despite having the global flag set on it. This is fixed by calling `exec` on the RegExp until it yields no further matches. Added a test for this error case. Fixes terser#180
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
When running the minifier with the following input:
And settings:
The output is:
Where it should be:
Full test program:
Version
7.2.0
What browsers are you seeing the problem on?
No response
Link to reproduce
https://stackblitz.com/edit/node-hnsagk?file=index.js
Relevant log output
No response
Willing to submit a PR?
None
The text was updated successfully, but these errors were encountered: