Add doc for 'postprocessor' option
Closed this issue · 2 comments
GoogleCodeExporter commented
Because there is no a server import feature I want to be able to remove the
@import on the fly
(currently several domains share stylesheets, and I want to test minify on
only one of them, if I can get minify to remove the imports I can use the
two methods side by side)
Please use labels and text to provide additional information.
I have attempted this myself by:
- adding $min_serveOptions['removeCssImports'] = true; to the config.php
- adding ,self::$_options['removeCssImports'] into the return of the
_getCacheId() method of Minify
- adding
}else if(self::$_options['removeCssImports']) {
preg_match_all('/@import.*?;/', $css, $imports);
$css = preg_replace('/@import.*?;/', '', $css);
into the _handleCssImports method of Minify
This seems to work a treat... is there any problems with this? and Can it
be added to future releases to save me updating my code every time there is
an update? :-)
Original issue reported on code.google.com by stevewhi...@gmail.com
on 25 Mar 2010 at 10:56
GoogleCodeExporter commented
You can instead rely on an undocumented feature that applies a function after
minification. In config.php:
function postMin($content, $type) {
return ($type === 'text/css')
? preg_replace('/@import.*?;/', '', $content)
: $content;
}
$min_serveOptions['postprocessor'] = 'postMin';
I'll mention this in the wiki.
Original comment by mrclay....@gmail.com
on 25 Mar 2010 at 1:24
- Changed title: Add doc for 'postprocessor' option
- Added labels: Type-Enhancement, Priority-Low, Component-Docs
- Removed labels: Type-Defect, Priority-Medium
GoogleCodeExporter commented
Added in R402
Original comment by mrclay....@gmail.com
on 25 Mar 2010 at 1:50
- Changed state: Verified