gulp-smoosher
Replaces css and js links with file contents
Install
Install with npm
npm install --save-dev gulp-smoosher
Example
index.html
<!-- smoosh --> <!-- endsmoosh --> ...
styles.css
Gulpfile.js
var gulp = ;var smoosher = ; gulp;
dist/index.html
...
Options
Custom js/css tags
Pass in custom js/css tags, if so desired. Example:
var gulp = ;var smoosher = ; gulp;
will result in the following:
body { background: red; } alert('Hello world!'); ...
base
dir
Custom Say your index.html
is still in your src/
directory and files you intend to smoosh are already written to your dist/
. In this case, specify a custom base
to resolve your files from.
gulp;
Ignore files not found
When the option ignoreFilesNotFound
is true the plugin will keep running even if it finds a nonexistent file:
gulp;
Notes
If you use grunt instead of gulp, but want to perform a similar task, use grunt-html-smoosher.
Contributors
- Gabriel Florit
- Andrew Shaffer
- Jackson Ray Hamilton
License
MIT © Gabriel Florit