Skip to content
Permalink
Browse files

feat(option): add option minify.css.splitMinFile to disable the split…

…ting of styles.min.css
  • Loading branch information
jyounce committed Jun 30, 2015
1 parent 9a40c94 commit 686b3fd46bb08d45035dd27594aac8489aa62ab7
Showing with 10 additions and 4 deletions.
  1. +1 −0 README.md
  2. +1 −0 config/config-minify.coffee
  3. +2 −0 config/config-options.coffee
  4. +6 −4 tasks/minify/css-file-split.coffee
@@ -128,6 +128,7 @@ gulp rapid-build:prod
# spa.exclude.scripts = (array of strings) = file paths: exclude files from automatically being generated in the spa.html and scripts.min.js file
# spa.exclude.styles = (array of strings) = file paths: exclude files from automatically being generated in the spa.html and styles.min.css file
# minify.css.styles = (boolean) defaults to true = for prod build, minify the css
# minify.css.splitMinFile = (boolean) defaults to true = for prod build, task for ie9 and below, split styles.min.css into multiple files if selector count > 4,095
# 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
# minify.js.scripts = (boolean) defaults to true = for prod build, minify the js
@@ -15,6 +15,7 @@ module.exports = (config, options) ->
minify =
css:
styles: getOption 'css', 'styles'
splitMinFile: getOption 'css', 'splitMinFile'
js:
scripts: getOption 'js', 'scripts'
mangle: getOption 'js', 'mangle'
@@ -33,6 +33,7 @@
# spa.exclude.scripts = (array of strings) = file paths: exclude files from automatically being generated in the spa.html and scripts.min.js file
# spa.exclude.styles = (array of strings) = file paths: exclude files from automatically being generated in the spa.html and styles.min.css file
# minify.css.styles = (boolean) defaults to true
# minify.css.splitMinFile = (boolean) defaults to true
# minify.html.views = (boolean) defaults to true
# minify.html.templateCache = (boolean) defaults to true
# minify.js.scripts = (boolean) defaults to true
@@ -110,6 +111,7 @@ module.exports = (config, options) ->
options.minify.html = {} if not isType.object options.minify.html
options.minify.js = {} if not isType.object options.minify.js
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
options.minify.html.templateCache = null if not isType.boolean options.minify.html.templateCache
options.minify.js.scripts = null if not isType.boolean options.minify.js.scripts
@@ -4,10 +4,11 @@
# If you don't care about those piece of shit browsers, then disable this option.
# ===============================================================================
module.exports = (gulp, config) ->
q = require 'q'
fs = require 'fs'
path = require 'path'
bless = require 'gulp-bless'
q = require 'q'
fs = require 'fs'
path = require 'path'
bless = require 'gulp-bless'
promiseHelp = require "#{config.req.helpers}/promise"

# tasks
# =====
@@ -34,6 +35,7 @@ module.exports = (gulp, config) ->
# register task
# =============
gulp.task "#{config.rb.prefix.task}css-file-split", ->
return promiseHelp.get() if not config.minify.css.splitMinFile
stylesDir = config.dist.app.client.styles.dir
minFile = config.fileName.styles.min
minPath = path.join stylesDir, minFile

0 comments on commit 686b3fd

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