Skip to content
Permalink
Browse files

feat(option): add build option browser.reload which defaults to true …

…and only applies to dev builds
  • Loading branch information
jyounce committed Nov 6, 2015
1 parent 206ade4 commit 354004d030cd3a4e753df0ed901b9c44da8b264b
Showing with 6 additions and 2 deletions.
  1. +1 −0 README.md
  2. +2 −1 config/config-browser.coffee
  3. +2 −1 config/config-options.coffee
  4. +1 −0 tasks/browser/browser-sync.coffee
@@ -184,6 +184,7 @@ package.json
# server.node_modules = (array of module names) = node_modules you would like to copy to the server dist, example: ['q']
# httpProxy = (array of objects) = object format: { context: array or string, options: object } for details see: https://www.npmjs.com/package/http-proxy-middleware
# browser.open = (boolean) defaults to true = open the browser once the build completes, applies to builds: default, dev and prod:server
# browser.reload = (boolean) defaults to true = reloads the browser once you save your src file, only applies to dev builds
# extra.copy[client|server] = (array of strings) = file paths: additional files to copy to dist/client and or dist/server that the build didn't copy
# extra.compile.client[coffee|es6|less|sass] = (array of strings) = file paths: additional files to compile to dist/client that the build didn't compile
# extra.compile.server[less|sass] = (array of strings) = file paths: additional files to compile to dist/server that the build didn't compile
@@ -5,7 +5,8 @@ module.exports = (config, options) ->
# init browser
# ============
browser = {}
browser.open = if options.browser.open is false then false else true
browser.open = if options.browser.open is false then false else true
browser.reload = if options.browser.reload is false then false else true

# add browser to config
# =====================
@@ -143,7 +143,8 @@ module.exports = (config, options) ->

browserOptions = ->
options.browser = {} unless isType.object options.browser
options.browser.open = null unless isType.boolean options.browser.open
options.browser.open = null unless isType.boolean options.browser.open
options.browser.reload = null unless isType.boolean options.browser.reload

# init
# ====
@@ -8,6 +8,7 @@ module.exports =
# ==============
init: (config) ->
promiseHelp = require "#{config.req.helpers}/promise"
return promiseHelp.get() unless config.browser.reload
return promiseHelp.get() unless config.build.server
@set()
.setBsConfig config

0 comments on commit 354004d

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