AddFuncRegexp adds a minify function to the mimetype => function map (unsafe for concurrent use).
(pattern *regexp.Regexp, minifier MinifierFunc)
| 159 | |
| 160 | // AddFuncRegexp adds a minify function to the mimetype => function map (unsafe for concurrent use). |
| 161 | func (m *M) AddFuncRegexp(pattern *regexp.Regexp, minifier MinifierFunc) { |
| 162 | m.mutex.Lock() |
| 163 | m.pattern = append(m.pattern, patternMinifier{pattern, minifier}) |
| 164 | m.mutex.Unlock() |
| 165 | } |
| 166 | |
| 167 | // AddCmd adds a minify function to the mimetype => function map (unsafe for concurrent use) that executes a command to process the minification. |
| 168 | // It allows the use of external tools like ClosureCompiler, UglifyCSS, etc. for a specific mimetype. |