-
Notifications
You must be signed in to change notification settings - Fork 42
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
Do not minify already minified files #75
Conversation
@Stolz Any comments on this ? |
@DarkaOnLine Sorry for the delay, I'm currently on vacation. I'll review it a few days. Thanks for your contribution. |
@Stolz ? |
@DarkaOnLine I'm not sure about this implementation, particularly with the use of loops to compare strings. Do you think you could use a regex approach similar to the one used for the If you take a look the current |
Are talking about stringContains method ? |
Yes. I think using preg_match() could do the trick |
OK. will change it |
Changed comparison to regexp |
* | ||
* @var array | ||
*/ | ||
//'exclude_minification_regex' => '/(.min.js|-min.js)$/i'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(pedant)
.
is a wildcard, which matches -
.
Perhaps [-.]min\.js$
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Yours pattern even significantly faster:
Time 1: 4.6014785766602E-5
Time 2: 1.8835067749023E-5
Closes #75 Merge remote-tracking branch 'pullrequest/exclude_minification' into develop
This has been merged. I refactored it a bit and the option has been renamed to Thanks again for your contribution. |
Some times JSMin will throw "Unterminated set in RegExp at byte" exception if the file is already minified. See more: http://www.mrclay.org/2013/11/27/jsmins-classic-delimma-division-or-regexp-literal/
Added possibility to exclude extensions from minification process.