Skip to content
Permalink
Browse files

fix(option): change option spa.exclude to spa.placeholders, makes mor…

…e sense
  • Loading branch information
jyounce committed Jun 29, 2015
1 parent dd7a7f8 commit 395cd37b5ba60486082743fdfaccab52c9580f90
Showing with 19 additions and 19 deletions.
  1. +1 −1 README.md
  2. +9 −9 config/config-options.coffee
  3. +3 −3 config/config-spa.coffee
  4. +6 −6 tasks/build/build-spa.coffee
@@ -124,7 +124,7 @@ gulp rapid-build:prod
# spa.src.file = (string) defaults to 'spa.html' = set if you want to use your own spa file and not the build system's (file must be located in your client src directory)
# spa.src.dir = (string) defaults to null = set if you are using your own spa file and that file is located in a directory in your client src directory
# spa.dist.file = (string) defaults to spa.src.file or 'spa.html' = provide if you want the dist spa file to be named differently, example: 'index.html'
# spa.exclude = (array of strings) = set to retain spa file placeholders, optional values are: ['scripts', 'styles', 'description', 'moduleName', 'title'] or ['all']
# spa.placeholders = (array of strings) = set to retain spa file placeholders, optional values are: ['scripts', 'styles', 'description', 'moduleName', 'title'] or ['all']
# minify.css.styles = (boolean) defaults to true = for prod build, minify the css
# minify.html.views = (boolean) defaults to true = for prod build, minify the html
# minify.html.templateCache = (boolean) defaults to true = for prod build, use the template cache
@@ -29,7 +29,7 @@
# spa.src.file = (string) defaults to 'spa.html'
# spa.src.dir = (string) defaults to null
# spa.dist.file = (string) defaults to spa.src.file or 'spa.html'
# spa.exclude = (array of strings) = optionals: ['scripts', 'styles', 'description', 'moduleName', 'title'] or ['all']
# spa.placeholders = (array of strings) = optionals: ['scripts', 'styles', 'description', 'moduleName', 'title'] or ['all']
# minify.css.styles = (boolean) defaults to true
# minify.html.views = (boolean) defaults to true
# minify.html.templateCache = (boolean) defaults to true
@@ -90,14 +90,14 @@ module.exports = (config, options) ->

spaOptions = ->
options.spa = {} if not isType.object options.spa
options.spa.title = null if not isType.string options.spa.title
options.spa.description = null if not isType.string options.spa.description
options.spa.src = {} if not isType.object options.spa.src
options.spa.dist = {} if not isType.object options.spa.dist
options.spa.exclude = null if not isType.array options.spa.exclude
options.spa.src.dir = null if not isType.string options.spa.src.dir
options.spa.src.file = null if not isType.string options.spa.src.file
options.spa.dist.file = null if not isType.string options.spa.dist.file
options.spa.title = null if not isType.string options.spa.title
options.spa.description = null if not isType.string options.spa.description
options.spa.src = {} if not isType.object options.spa.src
options.spa.dist = {} if not isType.object options.spa.dist
options.spa.placeholders = null if not isType.array options.spa.placeholders
options.spa.src.dir = null if not isType.string options.spa.src.dir
options.spa.src.file = null if not isType.string options.spa.src.file
options.spa.dist.file = null if not isType.string options.spa.dist.file

minifyOptions = ->
options.minify = {} if not isType.object options.minify
@@ -44,9 +44,9 @@ module.exports = (config, options) ->
file: srcFile
path: path.join srcDir, srcFile

# exclude
# =======
spa.exclude = options.spa.exclude or []
# placeholders
# ============
spa.placeholders = options.spa.placeholders or []

# add spa to config
# =================
@@ -11,13 +11,13 @@ module.exports = (gulp, config) ->
# helpers
# =======
runReplace = (type) ->
newKey = "<%= #{type} %>"
key = "<!--#include #{type}-->"
exclude = config.spa.exclude
replacePH = true # PH = placeholder
if exclude.indexOf('all') isnt -1
newKey = "<%= #{type} %>"
key = "<!--#include #{type}-->"
placeholders = config.spa.placeholders
replacePH = true # PH = placeholder
if placeholders.indexOf('all') isnt -1
replacePH = false
else if exclude.indexOf(type) isnt -1
else if placeholders.indexOf(type) isnt -1
replacePH = false
gulpif replacePH, replace key, newKey

0 comments on commit 395cd37

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