Skip to content
Permalink
Browse files

feat(option): add option exclude.from.minFile[scripts|styles] while m…

…aintaining order option
  • Loading branch information
jyounce committed Jul 13, 2015
1 parent 16affd2 commit 60634c9708d07f13f78b19b0abdbfaba23131746
@@ -11,7 +11,12 @@ phantomjsdriver.log
test-results.xml
Thumbs.db
/bower.json

# templates
# =========
config/config.json
files/prod-files-blueprint.json
files/prod-files.json
files/files.json
src/client/scripts/app.coffee

@@ -134,6 +134,7 @@ gulp rapid-build:prod
# 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
# exclude.angular.files = (boolean) defaults to false = set to true to exclude the angular files that come with rapid-build from dist (lib and modules)
# exclude.from.cacheBust = (array of strings) = file paths: exclude files from the cache bust
# exclude.from.minFile[scripts|styles] = (array of strings) = file paths: exclude script or style files from automatically being generated in the scripts.min.js or styles.min.css file
# exclude.from.spaFile[scripts|styles] = (array of strings) = file paths: exclude script or style files from automatically being generated in the spa.html file
# ========================================================================================================================================================================================================================
```
@@ -52,7 +52,8 @@ module.exports = (config, options) ->
continue unless _paths.length
_paths = (pathHelp.makeRelative _path for _path in _paths)
_paths = (path.join config.dist[appOrRb].client.dir, _path for _path in _paths)
_paths = ("!#{_path}" for _path in _paths)
negate = if opt is 'minFile' then '' else '!'
_paths = ("#{negate}#{_path}" for _path in _paths)
# log.json _paths
if forType
exclude[appOrRb].from[opt][type] = _paths
@@ -39,8 +39,8 @@
# minify.cacheBust = (boolean) defaults to true
# exclude.angular.files = (boolean) defaults to false
# exclude.from.cacheBust = (array of strings) = file paths: exclude files from the cache bust
# exclude.from.spaFile[scripts|styles] = (array of strings) = file paths: exclude script or style files from automatically being generated in the spa.html file
# exclude.from.minFile[scripts|styles] = (array of strings) = file paths: exclude script or style files from automatically being generated in the scripts.min.js or styles.min.css file
# exclude.from.spaFile[scripts|styles] = (array of strings) = file paths: exclude script or style files from automatically being generated in the spa.html file
# =============================================================================================================================================================================================
module.exports = (config, options) ->
log = require "#{config.req.helpers}/log"
@@ -24,6 +24,12 @@ module.exports = (config, options) ->
srcFile = options.spa.src.file or 'spa.html'
distFile = options.spa.dist.file or srcFile
srcDir = getSrcDir custom, options.spa.src.dir
if custom
customDistDir = path.join(
config.dist.app.client.dir
options.spa.src.dir
)
customDistPath = path.join customDistDir, srcFile

# init spa
# ========
@@ -37,6 +43,9 @@ module.exports = (config, options) ->
spa.dist =
file: distFile
path: path.join config.dist.app.client.dir, distFile
custom:
dir: customDistDir or null
path: customDistPath or null

# src
# ===
@@ -5,77 +5,78 @@
module.exports = (gulp, config) ->
# browser
# =======
bs = require("#{config.req.tasks}/browser/browser-sync") gulp, config # browser-sync
require("#{config.req.tasks}/browser/open-browser") gulp, config # open-browser
bs = require("#{config.req.tasks}/browser/browser-sync") gulp, config # browser-sync
require("#{config.req.tasks}/browser/open-browser") gulp, config # open-browser

# build
# =====
require("#{config.req.tasks}/build/build-angular-modules") gulp, config # build-angular-modules
require("#{config.req.tasks}/build/build-bower-json") gulp, config # build-bower-json
require("#{config.req.tasks}/build/build-config") gulp, config # build-config
require("#{config.req.tasks}/build/build-files") gulp, config # build-files
require("#{config.req.tasks}/build/build-files-prod") gulp, config # build-files-prod
require("#{config.req.tasks}/build/build-spa") gulp, config # build-spa
require("#{config.req.tasks}/build/build-angular-modules") gulp, config # build-angular-modules
require("#{config.req.tasks}/build/build-bower-json") gulp, config # build-bower-json
require("#{config.req.tasks}/build/build-config") gulp, config # build-config
require("#{config.req.tasks}/build/build-files") gulp, config # build-files
require("#{config.req.tasks}/build/build-prod-files") gulp, config # build-prod-files
require("#{config.req.tasks}/build/build-prod-files-blueprint") gulp, config # build-prod-files-blueprint
require("#{config.req.tasks}/build/build-spa") gulp, config # build-spa

# clean
# =====
require("#{config.req.tasks}/clean/clean-config") gulp, config # clean-config
require("#{config.req.tasks}/clean/clean-dist") gulp, config # clean-dist
require("#{config.req.tasks}/clean/clean-files") gulp, config # clean-files
require("#{config.req.tasks}/clean/cleanup-client") gulp, config # cleanup-client
require("#{config.req.tasks}/clean/clean-config") gulp, config # clean-config
require("#{config.req.tasks}/clean/clean-dist") gulp, config # clean-dist
require("#{config.req.tasks}/clean/clean-files") gulp, config # clean-files
require("#{config.req.tasks}/clean/cleanup-client") gulp, config # cleanup-client

# common
# ======
require("#{config.req.tasks}/common") gulp, config # common
require("#{config.req.tasks}/common") gulp, config # common

# compile
# =======
require("#{config.req.tasks}/compile/coffee") gulp, config # coffee
require("#{config.req.tasks}/compile/es6") gulp, config # es6
require("#{config.req.tasks}/compile/less") gulp, config # less
require("#{config.req.tasks}/compile/coffee") gulp, config # coffee
require("#{config.req.tasks}/compile/es6") gulp, config # es6
require("#{config.req.tasks}/compile/less") gulp, config # less

# config
# ======
require("#{config.req.tasks}/config/update-config") gulp, config # update-config
require("#{config.req.tasks}/config/update-config") gulp, config # update-config

# copy
# ====
require("#{config.req.tasks}/copy/copy-bower_components") gulp, config # copy-bower_components
require("#{config.req.tasks}/copy/copy-css") gulp, config # copy-css
require("#{config.req.tasks}/copy/copy-html") gulp, config # copy-html
require("#{config.req.tasks}/copy/copy-images") gulp, config # copy-images
require("#{config.req.tasks}/copy/copy-js") gulp, config # copy-js
require("#{config.req.tasks}/copy/copy-libs") gulp, config # copy-libs
require("#{config.req.tasks}/copy/copy-server-config") gulp, config # copy-server-config
require("#{config.req.tasks}/copy/copy-server-node_modules") gulp, config # copy-server-node_modules
require("#{config.req.tasks}/copy/copy-views") gulp, config # copy-views
require("#{config.req.tasks}/copy/copy-bower_components") gulp, config # copy-bower_components
require("#{config.req.tasks}/copy/copy-css") gulp, config # copy-css
require("#{config.req.tasks}/copy/copy-html") gulp, config # copy-html
require("#{config.req.tasks}/copy/copy-images") gulp, config # copy-images
require("#{config.req.tasks}/copy/copy-js") gulp, config # copy-js
require("#{config.req.tasks}/copy/copy-libs") gulp, config # copy-libs
require("#{config.req.tasks}/copy/copy-server-config") gulp, config # copy-server-config
require("#{config.req.tasks}/copy/copy-server-node_modules") gulp, config # copy-server-node_modules
require("#{config.req.tasks}/copy/copy-views") gulp, config # copy-views

# manage
# ======
require("#{config.req.tasks}/manage/bower") gulp, config # bower
require("#{config.req.tasks}/manage/bower") gulp, config # bower

# minify
# ======
require("#{config.req.tasks}/minify/cache-bust") gulp, config # cache-bust
require("#{config.req.tasks}/minify/concat-scripts-and-styles") gulp, config # concat-scripts-and-styles
require("#{config.req.tasks}/minify/css-file-split") gulp, config # css-file-split
require("#{config.req.tasks}/minify/minify-client") gulp, config # minify-client
require("#{config.req.tasks}/minify/minify-css") gulp, config # minify-css
require("#{config.req.tasks}/minify/minify-html") gulp, config # minify-html
require("#{config.req.tasks}/minify/minify-images") gulp, config # minify-images
require("#{config.req.tasks}/minify/minify-js") gulp, config # minify-js
require("#{config.req.tasks}/minify/minify-server") gulp, config # minify-server
require("#{config.req.tasks}/minify/minify-spa") gulp, config # minify-spa
require("#{config.req.tasks}/minify/template-cache") gulp, config # template-cache
require("#{config.req.tasks}/minify/cache-bust") gulp, config # cache-bust
require("#{config.req.tasks}/minify/concat-scripts-and-styles") gulp, config # concat-scripts-and-styles
require("#{config.req.tasks}/minify/css-file-split") gulp, config # css-file-split
require("#{config.req.tasks}/minify/minify-client") gulp, config # minify-client
require("#{config.req.tasks}/minify/minify-css") gulp, config # minify-css
require("#{config.req.tasks}/minify/minify-html") gulp, config # minify-html
require("#{config.req.tasks}/minify/minify-images") gulp, config # minify-images
require("#{config.req.tasks}/minify/minify-js") gulp, config # minify-js
require("#{config.req.tasks}/minify/minify-server") gulp, config # minify-server
require("#{config.req.tasks}/minify/minify-spa") gulp, config # minify-spa
require("#{config.req.tasks}/minify/template-cache") gulp, config # template-cache

# server
# ======
require("#{config.req.tasks}/server/start-server") gulp, config # start-server
require("#{config.req.tasks}/server/nodemon") gulp, config, bs # nodemon
require("#{config.req.tasks}/server/start-server") gulp, config # start-server
require("#{config.req.tasks}/server/nodemon") gulp, config, bs # nodemon

# watch
# =====
require("#{config.req.tasks}/watch/watch") gulp, config, bs # watch
require("#{config.req.tasks}/watch/watch-build-spa") gulp, config # watch-build-spa
require("#{config.req.tasks}/watch/watch") gulp, config, bs # watch
require("#{config.req.tasks}/watch/watch-build-spa") gulp, config # watch-build-spa


This file was deleted.

0 comments on commit 60634c9

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