Skip to content

Commit

Permalink
Improve build process
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 1, 2016
1 parent 5854685 commit f5ce0be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
16 changes: 7 additions & 9 deletions gulpfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
# -- Dependencies --------------------------------------------------------------

gulp = require 'gulp'
gutil = require 'gulp-util'
gulpif = require 'gulp-if'
sass = require 'gulp-sass'
concat = require 'gulp-concat'
cssmin = require 'gulp-cssmin'
cssnano = require 'gulp-cssnano'
addsrc = require 'gulp-add-src'
changed = require 'gulp-changed'
shorthand = require 'gulp-shorthand'
prefix = require 'gulp-autoprefixer'
strip = require 'gulp-strip-css-comments'

printError = (err) -> gutil.log err.toString()
isProduction = process.env.NODE_ENV is 'production'

# -- Files ---------------------------------------------------------------------

Expand All @@ -36,12 +35,11 @@ gulp.task 'css', ->
gulp.src src.css.vendor
.pipe changed dist.css
.pipe addsrc src.sass.main
.pipe sass().on 'error', printError
.pipe sass().on('error', sass.logError)
.pipe concat '' + dist.name + '.css'
.pipe prefix()
.pipe strip all: true
.pipe shorthand()
.pipe cssmin()
.pipe gulpif(isProduction, prefix())
.pipe gulpif(isProduction, strip all: true)
.pipe gulpif(isProduction, cssnano())
.pipe gulp.dest dist.css
return

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
"gulp-autoprefixer": "latest",
"gulp-changed": "latest",
"gulp-concat": "latest",
"gulp-cssmin": "latest",
"gulp-cssnano": "latest",
"gulp-if": "latest",
"gulp-sass": "latest",
"gulp-shorthand": "latest",
"gulp-strip-css-comments": "latest",
"gulp-util": "latest",
"husky": "latest",
"standard": "latest",
"standard-markdown": "latest"
Expand Down

0 comments on commit f5ce0be

Please sign in to comment.