AddCmdRegexp adds a minify function to the mimetype => function map (unsafe for concurrent use) that executes a command to process the minification. It allows the use of external tools like ClosureCompiler, UglifyCSS, etc. for a specific mimetype regular expression.
(pattern *regexp.Regexp, cmd *exec.Cmd)
| 175 | // AddCmdRegexp adds a minify function to the mimetype => function map (unsafe for concurrent use) that executes a command to process the minification. |
| 176 | // It allows the use of external tools like ClosureCompiler, UglifyCSS, etc. for a specific mimetype regular expression. |
| 177 | func (m *M) AddCmdRegexp(pattern *regexp.Regexp, cmd *exec.Cmd) { |
| 178 | m.mutex.Lock() |
| 179 | m.pattern = append(m.pattern, patternMinifier{pattern, &cmdMinifier{cmd}}) |
| 180 | m.mutex.Unlock() |
| 181 | } |
| 182 | |
| 183 | // Match returns the pattern and minifier that gets matched with the mediatype. |
| 184 | // It returns nil when no matching minifier exists. |