From 75d107e22030b812978890c84c30f3bcd7b5d198 Mon Sep 17 00:00:00 2001 From: Xaver Maierhofer Date: Sun, 29 May 2016 18:22:06 +0200 Subject: [PATCH] [TASK] Add cache breaker --- Gruntfile.js | 3 +-- package.json | 1 + tasks/build.js | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index fb6d439..0922dff 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,8 +3,7 @@ module.exports = function (grunt) { grunt.loadTasks("tasks"); - grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass", "postcss", "requirejs:default", "inline"]); + grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass", "postcss", "requirejs:default", "cachebreaker", "inline"]); grunt.registerTask("lint", ["sasslint", "eslint"]); grunt.registerTask("serve", ["bower-install-simple", "lint", "copy", "sass", "requirejs:dev", "browserSync", "watch"]); }; - diff --git a/package.json b/package.json index 6d52ef5..5315e6e 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "grunt": "^1.0.1", "grunt-bower-install-simple": "^1.2.3", "grunt-browser-sync": "^2.2.0", + "grunt-cache-breaker": "^2.0.1", "grunt-check-dependencies": "^0.12.0", "grunt-contrib-clean": "^1.0.0", "grunt-contrib-copy": "^1.0.0", diff --git a/tasks/build.js b/tasks/build.js index 8b029d2..15d1824 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -120,6 +120,16 @@ module.exports = function (grunt) { build: false } } + }, + cachebreaker: { + default: { + options: { + match: ['app.js'] + }, + files: { + src: ['build/index.html'] + } + } } }); @@ -129,4 +139,5 @@ module.exports = function (grunt) { grunt.loadNpmTasks("grunt-sass"); grunt.loadNpmTasks("grunt-postcss"); grunt.loadNpmTasks("grunt-inline"); + grunt.loadNpmTasks("grunt-cache-breaker"); };