Skip to content

Commit

Permalink
(feat) Use gulp-rev for cache busting js and css
Browse files Browse the repository at this point in the history
When in production, Gulp will revision the minified file names for
cache busting purposes.
  • Loading branch information
dustinspecker committed Sep 1, 2014
1 parent 14dbb96 commit d1aef1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/templates/_gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,14 @@ gulp.task('scripts', ['clean', 'jshint', 'coffeelint'], function () {
.pipe(plugins.angularFilesort())
.pipe(plugins.ngAnnotate())
.pipe(plugins.concat('app.js'))
.pipe(plugins.streamify(plugins.rev()))
.pipe(plugins.uglify())

This comment has been minimized.

Copy link
@dustinspecker

dustinspecker Sep 3, 2014

Author Owner

7329ad3 Fixed

.pipe(appFilter.restore())
.pipe(bowerFilter)
.pipe(plugins.angularFilesort())
.pipe(plugins.order(['**/angular.min.js']))
.pipe(plugins.concat('vendor.js'))
.pipe(plugins.streamify(plugins.rev()))

This comment has been minimized.

Copy link
@dustinspecker

dustinspecker Sep 5, 2014

Author Owner

0d8df10 No longer uses minified versions of vendor files and now uses wiredep.

.pipe(bowerFilter.restore())
.pipe(gulp.dest(buildJs));
} else {
Expand Down Expand Up @@ -408,10 +410,12 @@ gulp.task('style', ['clean'], function () {
.pipe(plugins.autoprefixer())
.pipe(appFilter)
.pipe(plugins.concat('style.css'))
.pipe(plugins.streamify(plugins.rev()))
.pipe(plugins.cssmin())
.pipe(appFilter.restore())
.pipe(bowerFilter)
.pipe(plugins.concat('vendor.css'))
.pipe(plugins.streamify(plugins.rev()))
.pipe(plugins.cssmin())
.pipe(bowerFilter.restore())
.pipe(gulp.dest(buildCss));
Expand Down Expand Up @@ -458,7 +462,7 @@ gulp.task('markup', ['clean'], function () {
gulp.task('inject', [<% if (polymer) { %>'components', <% } %>'markup', 'scripts', 'style'], function () {
return gulp.src(build + 'index.html')
.pipe(plugins.inject(gulp.src([
buildCss + 'vendor.css',
buildCss + 'vendor*.css',
<% if (framework === 'angularstrap' || framework === 'uibootstrap') { %>buildCss + 'bootstrap.css',
<% } %><% if (framework === 'foundation') { %>buildCss + 'normalize.css',
buildCss + 'foundation.css',
Expand Down
2 changes: 2 additions & 0 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"gulp-order": "^1.1.1",
"gulp-plato": "^0.2.1",
"gulp-protractor": "^0.0.11",
"gulp-rev": "^1.1.0",
"gulp-sass": "^0.7.2",
"gulp-streamify": "0.0.5",
"gulp-stylus": "^0.2.0",
"gulp-uglify": "^0.3.1",
"jshint-stylish": "^0.2.0",
Expand Down

0 comments on commit d1aef1f

Please sign in to comment.