Skip to content
Permalink
Browse files

feat(option): add build option browser.open, default to true

  • Loading branch information
jyounce committed Sep 24, 2015
1 parent c047426 commit 5885e176f7462e45d5dedb67985ee46acc38d39b
@@ -150,6 +150,7 @@ gulp rapid-build:test:prod
# test.browsers = (array of browser names) = phantomjs will run by default, optional browser names are ['chrome', 'firefox', 'ie', 'safari']
# 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
# 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
@@ -16,6 +16,7 @@ module.exports = (rbDir, options) ->
config = require("#{config.req.config}/config-build") config, options
config = require("#{config.req.config}/config-ports") config, options
config = require("#{config.req.config}/config-server") config
config = require("#{config.req.config}/config-browser") config, options
config = require("#{config.req.config}/config-file-names") config
config = require("#{config.req.config}/config-minify") config, options
config = require("#{config.req.config}/config-dist-and-src") config, options
@@ -0,0 +1,26 @@
module.exports = (config, options) ->
log = require "#{config.req.helpers}/log"
test = require("#{config.req.helpers}/test")()

# init browser
# ============
browser = {}
browser.open = if options.browser.open is false then false else true

# add browser to config
# =====================
config.browser = browser

# logs
# ====
# log.json browser, 'browser ='

# tests
# =====
test.log 'true', config.browser, 'add browser to config'

# return
# ======
config


@@ -133,6 +133,10 @@ module.exports = (config, options) ->
extraCopy()
extraCompile()

browserOptions = ->
options.browser = {} if not isType.object options.browser
options.browser.open = null if not isType.boolean options.browser.open

# init
# ====
buildOptions()
@@ -147,6 +151,7 @@ module.exports = (config, options) ->
serverDistOptions()
serverOptions()
proxyOptions()
browserOptions()
extraOptions()

# logs
@@ -12,7 +12,7 @@ module.exports = (gulp, config) ->
port: config.ports.reload
ui: port: config.ports.reloadUI
browser: 'google chrome'
# open: false
open: config.browser.open

# events
# ======
@@ -11,4 +11,5 @@ module.exports = (gulp, config) ->

gulp.task "#{config.rb.prefix.task}open-browser", ->
return promiseHelp.get() unless config.build.server
return promiseHelp.get() unless config.browser.open
runTask config.ports.server

0 comments on commit 5885e17

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