Replaces references to non-optimized scripts or stylesheets into a set of HTML files (or any templates/views).
npm install usemin-cli


> CLI version of usemin. For _purists_, those who don't use build tools like Grunt and Gulp, but just use NPM as their build tool.
Install with npm:
```
npm install usemin-cli
``
usemin [input.html] [--dest|-d dir] [--output|-o output.html] [options]`$3
`
usemin src/index.html --dest dist --output dist/index.html
usemin src/index.html -d dist -o dist/index.html
usemin src/index.html -d dist > dist/index.html
usemin src/index.html -d dist -o dist/index.html --htmlmin true --rmlr true
usemin src/index.html -d dist -o dist/index.html --htmlmin true -c config.js
--htmlmin - Also minifies the input HTML file (Boolean)
--rmlr, --removeLivereload - Remove livereload script (Boolean)
--noprocess - Do not process files, just replace references (Boolean)
-c, --config - Supply a configurations file for UglifyJS, CleanCSS and HTML minifier.
--listblocks - Write blocks to stdout or filename.json.
E.g., --listblocks // print to stdout
--listblocks blocks.json // write to blocks.json
`$3
#### Blocks
Blocks are expressed as:
`html
... HTML Markup, list of script / link tags.
`- pipelineId: pipeline id for options or remove to remove a section
- alternate search path: (optional) By default the input files are relative to the treated file. Alternate search path allows one to change that
- path: the file path of the optimized file, the target output
`html
`
Running the command with --rmlr true will output:
`
`#### Alternate search path
`html
`$3
Please check the relevant documentations for the available options: UglifyJS, CleanCSS and HTML minifier.
`JavaScript
module.exports = {
uglifyjs: {
// ... UglifyJS API options
},
cleancss: {
// ... CleanCSS API options
},
htmlminifier: {
// ... HTML minifier API options
}
}
``