-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.coffee
80 lines (68 loc) · 2.34 KB
/
gulpfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
gulp = require 'gulp'
coffee = require 'gulp-coffee'
coffeelint = require 'gulp-coffeelint'
jshint = require 'gulp-jshint'
uglify = require 'gulp-uglify'
minifyCss = require 'gulp-minify-css'
rename = require 'gulp-rename'
concat = require 'gulp-concat'
concatCss = require 'gulp-concat-css'
series = require 'stream-series'
del = require 'del'
codo = require 'gulp-codo'
config = require './gulp-config.json'
gulp.task 'api.lint', ->
gulp.src config.api.src
.pipe coffeelint()
.pipe coffeelint.reporter()
gulp.task 'api.js', ['clean.js', 'api.lint'], ->
gulp.src config.api.src
.pipe coffee()
.pipe gulp.dest config.dest.js
.pipe uglify()
.pipe rename extname: '.min.js'
.pipe gulp.dest config.dest.js
gulp.task 'api.doc', ['clean.doc'], ->
gulp.src config.api.src
.pipe codo
name: "SizeMe API"
title: "API documentation for SizeMe"
readme: "README.md"
dir: config.dest.doc
gulp.task 'magento.lint', ->
gulp.src config.magento.js
.pipe jshint()
.pipe jshint.reporter("default")
gulp.task 'magento.js', ['clean.js', 'magento.lint'], ->
gulp.src config.magento.js
.pipe concat("sizeme-magento.js")
.pipe gulp.dest config.dest.js
.pipe uglify()
.pipe rename extname: '.min.js'
.pipe gulp.dest config.dest.js
gulp.task 'magento-with-deps', ['magento.js'], ->
series gulp.src(config.jquery_ui.js)
, gulp.src(config.opentip.js)
, gulp.src(config.dest + "/sizeme-magento.js")
.pipe concat("sizeme-magento-with-deps.js")
.pipe gulp.dest config.dest.js
.pipe uglify()
.pipe rename extname: '.min.js'
.pipe gulp.dest config.dest.js
gulp.task 'magento.css', ['clean.css'], ->
series gulp.src(config.jquery_ui.css)
, gulp.src(config.opentip.css)
, gulp.src(config.magento.css)
.pipe concatCss "sizeme-magento.css", rebaseUrls: false
.pipe gulp.dest config.dest.css
.pipe minifyCss keepSpecialComments: "*"
.pipe rename extname: '.min.css'
.pipe gulp.dest config.dest.css
gulp.task 'clean.js', (cb) ->
del [ config.dest.js ], cb
gulp.task 'clean.doc', (cb) ->
del [ config.dest.doc ], cb
gulp.task 'clean.css', (cb) ->
del [ config.dest.css + "/**/*.css" ], cb
gulp.task 'clean', [ 'clean.js', 'clean.css', 'clean.doc' ]
gulp.task 'default', ['api.js', 'api.doc', 'magento-with-deps', 'magento.css']