MCPcopy
hub / github.com/tdewolff/minify / AddCmd

Method AddCmd

minify.go:169–173  ·  view source on GitHub ↗

AddCmd 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.

(mimetype string, cmd *exec.Cmd)

Source from the content-addressed store, hash-verified

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.
169func (m *M) AddCmd(mimetype string, cmd *exec.Cmd) {
170 m.mutex.Lock()
171 m.literal[mimetype] = &cmdMinifier{cmd}
172 m.mutex.Unlock()
173}
174
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.

Callers 1

TestAddFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestAddFunction · 0.64