Replace references from non-optimized scripts, stylesheets and other assets to their optimized version within a set of HTML files
This plugin requires Gulp ~3.8.10
If you haven't used Gulp before, be sure to check out the Getting Started guide, as it explains how to create a Gulpfile as well as install and use Gulp plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install gulp-usemin-html --save-dev
Once the plugin has been installed, it may be enabled inside your Gulpfile with this line of JavaScript:
var htmlusemin = require('gulp-usemin-html')
In your project's Gulpfile, add a section.
gulp.task('htmlusemin', function() {
return gulp.src([basepath + '/source/**/*.html'])
.pipe(usemin({
js: {
suffix: '-min',
enable: true
},
css: {
suffix: '.min',
enable: true
}
}))
.pipe(gulp.dest(basepath + '/build/'));
});
Type: Object
Default value: { suffix: '.min', enable: true }
Type: Object
Default value: { suffix: '.min', enable: true }
In this example,replaces references from non-optimized scripts, stylesheets and other assets to their optimized version within a set of HTML files`
gulp.task('htmlusemin', function() {
return gulp.src([basepath + '/source/**/*.html'])
.pipe(usemin({
js: {
suffix: '-min',
enable: true
},
css: {
suffix: '.min',
enable: true
}
}))
.pipe(gulp.dest(basepath + '/build/'));
});
(Nothing yet)