-
-
Notifications
You must be signed in to change notification settings - Fork 22
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 with strings values minification #20
Comments
Package ver. 3.3.4 |
Also, a good idea to add this regex to remove /* Comments like this */
|
@dipeshsukhia, could you please participate? |
news ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, we discovered a problem with minification.
We've string like "Hello (or hi), world" in
tag, and after minification output looks like "Hello (or hi),world".
Looks like that's a bug and I can't fix that by adding an extra exclude regex in config, I can exclude routes only.
I think this one regex causes this.
//remove new-line after JS's line end (only most obvious and safe cases)
'/),[\r\n\t ]+/s' => '),',
I bypassed this by adding @excludeMinify and @endExcludeMinify, but that's adding and comments to production.
If we add this to all user inputs, that will cost us hundreds of megabytes of traffic per month (comment size multiplied by inputs multiplied by users count multiplied by pageviews (at least: 57 bytes * 15 user's input fields (maybe more, the maximum is about 1000) * about at least 100.000 page views (for all users) by month (real count can be times more) = about 85.5mb for absolutely unnecessary for users data, maximum up to 57 GB per month).
Is it possible to add some additional configs like disabling some minifications and adding custom minifications
or modify the regex to add space after '),' like this '), ' (simple way),
or ignore values from some HTML tags like
<h1-6>
<p>
<span>
<title>
<meta>
(like og:description) etc, which can contain the user's input, because in our case all is affected (I think best of the best but hard to implement)What do you think about this?
The text was updated successfully, but these errors were encountered: