Skip to content
Permalink
Browse files

feat(option): add option to disable cache busting via option.minify.c…

…acheBust
  • Loading branch information
jyounce committed Jul 2, 2015
1 parent 7f66d19 commit 6d445c7c3281514d6871233d0b309e77e4c9dbff
Showing with 13 additions and 3 deletions.
  1. +1 −0 README.md
  2. +6 −0 config/config-minify.coffee
  3. +5 −3 config/config-options.coffee
  4. +1 −0 tasks/minify/cache-bust.coffee
@@ -133,6 +133,7 @@ gulp rapid-build:prod
# minify.html.templateCache = (boolean) defaults to true = for prod build, use the template cache
# minify.js.scripts = (boolean) defaults to true = for prod build, minify the js
# minify.js.mangle = (boolean) defaults to true = for prod build, mangle the names in the js
# minify.cacheBust = (boolean) defaults to true = for prod build, ensures the user always receives the latest files, adds an md5 checksum to the client files before their extension
# ========================================================================================================================================================================================================================
```

@@ -25,6 +25,12 @@ module.exports = (config, options) ->
options: # not configurable
conditionals:true, empty:true, ssi:true

# cache bust
# ==========
cacheBustOpt = options.minify.cacheBust
minify.cacheBust =
if isType.null cacheBustOpt then true else cacheBustOpt

# add minify to config
# ====================
config.minify = minify
@@ -38,6 +38,7 @@
# minify.html.templateCache = (boolean) defaults to true
# minify.js.scripts = (boolean) defaults to true
# minify.js.mangle = (boolean) defaults to true
# minify.cacheBust = (boolean) defaults to true
# =========================================================================================================================================================================
module.exports = (config, options) ->
log = require "#{config.req.helpers}/log"
@@ -107,9 +108,10 @@ module.exports = (config, options) ->

minifyOptions = ->
options.minify = {} if not isType.object options.minify
options.minify.css = {} if not isType.object options.minify.css
options.minify.html = {} if not isType.object options.minify.html
options.minify.js = {} if not isType.object options.minify.js
options.minify.css = {} if not isType.object options.minify.css
options.minify.html = {} if not isType.object options.minify.html
options.minify.js = {} if not isType.object options.minify.js
options.minify.cacheBust = null if not isType.boolean options.minify.cacheBust
options.minify.css.styles = null if not isType.boolean options.minify.css.styles
options.minify.css.splitMinFile = null if not isType.boolean options.minify.css.splitMinFile
options.minify.html.views = null if not isType.boolean options.minify.html.views
@@ -67,6 +67,7 @@ module.exports = (gulp, config) ->
# register task
# =============
gulp.task "#{config.rb.prefix.task}cache-bust", ->
return promiseHelp.get() if not config.minify.cacheBust
runCacheBustTask()


0 comments on commit 6d445c7

Please sign in to comment.
You can’t perform that action at this time.