Skip to content

Commit

Permalink
Merge pull request jamesknelson#54 from PointSource/feature/README-up…
Browse files Browse the repository at this point in the history
…date-gulp-useref

Updates to the README
  • Loading branch information
James K Nelson committed Mar 19, 2016
2 parents c7cc3cb + cc3a893 commit 0033a37
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,21 @@ var uglify = require('gulp-uglify');
var csso = require('gulp-csso');

gulp.task("index", function() {
var jsFilter = filter("**/*.js");
var cssFilter = filter("**/*.css");

var userefAssets = useref.assets();
var jsFilter = filter("**/*.js", { restore: true });
var cssFilter = filter("**/*.css", { restore: true });
var indexHtmlFilter = filter(['**/*', '!**/index.html'], { restore: true });

return gulp.src("src/index.html")
.pipe(userefAssets) // Concatenate with gulp-useref
.pipe(useref()) // Concatenate with gulp-useref
.pipe(jsFilter)
.pipe(uglify()) // Minify any javascript sources
.pipe(jsFilter.restore())
.pipe(jsFilter.restore)
.pipe(cssFilter)
.pipe(csso()) // Minify any CSS sources
.pipe(cssFilter.restore())
.pipe(rev()) // Rename the concatenated files
.pipe(userefAssets.restore())
.pipe(useref())
.pipe(cssFilter.restore)
.pipe(indexHtmlFilter)
.pipe(rev()) // Rename the concatenated files (but not index.html)
.pipe(indexHtmlFilter.restore)
.pipe(revReplace()) // Substitute in new filenames
.pipe(gulp.dest('public'));
});
Expand Down

0 comments on commit 0033a37

Please sign in to comment.