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
Minifying options #172
Comments
What about files that may have been already minified? In order to identify these cases, for any level, a blacklist of resources that should not be compressed ( but joined ) should be provided |
There are severe performance issues if you try to minify bootstrap sources with many files. Sometimes even max_execution_time gets triggered. Maybe detection of .min. in filenames would be enough for skipping minification on minified sources. |
Ignoring already minified file and only concatenating them would definitely be a noticeable performance improvement, especially with heavy files. Ideally |
How about an alternative? I agree that files that are already minified should not be minified again. Following the advice from issue #158, I let the code calling Minify decide whether to do a full minification or a basic minification. Here's my code for a basic minification: class MinifyBasic extends Minify {
// Minify data, remove only comments and empty lines
public function execute($path = null) {
$content = "";
$this->extractStrings('\'"`');
foreach ($this->data as $source => $data) {
$data = $this->replace($data);
$data = preg_replace("/\/\*.*?\*\//s", "", $data);
$data = preg_replace("/\/\/.*?[\r\n]+/", "", $data);
$data = preg_replace("/[\r\n]+/", "\n", $data);
$content .= trim($data);
}
return $this->restoreExtractedData($content);
}
} |
I'm going to decline this ticket. I'm not opposed to the idea per se, but:
The only sensible use case I can think of (and that seems to be echoed in the following comments) is combining new source files (that should be minified) with already-minified (that should not be minified again). I'm going to close this, but feel free to reopen if you feel there's a compelling reason that something along these lines should be implemented. |
It would be nice to have an option to decide which type of compression to apply, this could be like:
Level 1 - just join the resources file (this may be useful when debugging)
Level 2 - Join and strip whitespaces
Level 3 - Current level of compression, so minify + uglify
The text was updated successfully, but these errors were encountered: