Skip to content

Commit f21a388

Browse files
committed
feat(gulp): update useref to latest version
1 parent 9596ba4 commit f21a388

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Diff for: app/templates/_package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"gulp-sourcemaps": "^1.5.2",
6969
"gulp-svgmin": "^1.1.2",
7070
"gulp-uglify": "^1.2.0",
71-
"gulp-useref": "^1.2.0",
71+
"gulp-useref": "^3.0.3",
7272
"gulp-util": "^3.0.5",
7373
"gulp-watch": "^4.3.5",<% if(filters.jade) { %>
7474
"gulp-jade": "^1.0.1",<% } if(filters.stylus) { %>

Diff for: app/templates/gulpfile.babel(gulp).js

+6-8
Original file line numberDiff line numberDiff line change
@@ -460,14 +460,12 @@ gulp.task('build:client', ['transpile:client', 'styles', 'html'], () => {
460460
var appFilter = plugins.filter('**/app.js');
461461
var jsFilter = plugins.filter('**/*.js');
462462
var cssFilter = plugins.filter('**/*.css');
463-
var htmlFilter = plugins.filter('**/*.html');<% if(filters.jade) { %>
463+
var htmlBlock = plugins.filter(['**/*.!(html)']);<% if(filters.jade) { %>
464464
var assetsFilter = plugins.filter('**/*.{js,css}');<% } %>
465465

466-
let assets = plugins.useref.assets({searchPath: [clientPath, '.tmp']});
467-
468466
return gulp.src(paths.client.mainView)<% if(filters.jade) { %>
469467
.pipe(plugins.jade({pretty: true}))<% } %>
470-
.pipe(assets)
468+
.pipe(plugins.useref())
471469
.pipe(appFilter)
472470
.pipe(plugins.addSrc.append('.tmp/templates.js'))
473471
.pipe(plugins.concat('app/app.js'))
@@ -482,10 +480,10 @@ gulp.task('build:client', ['transpile:client', 'styles', 'html'], () => {
482480
processImportFrom: ['!fonts.googleapis.com']
483481
}))
484482
.pipe(cssFilter.restore())
485-
.pipe(plugins.rev())
486-
.pipe(assets.restore())
487-
.pipe(plugins.revReplace())
488-
.pipe(plugins.useref())<% if(filters.jade) { %>
483+
.pipe(htmlBlock)
484+
.pipe(plugins.rev())
485+
.pipe(htmlBlock.restore())
486+
.pipe(plugins.revReplace())<% if(filters.jade) { %>
489487
.pipe(assetsFilter)<% } %>
490488
.pipe(gulp.dest(`${paths.dist}/${clientPath}`));
491489
});

0 commit comments

Comments
 (0)