-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
53 lines (47 loc) · 1.59 KB
/
gulpfile.js
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
var gulp = require('gulp');
var nodemon = require('gulp-nodemon');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
gulp.task('join_js', function() {
gulp.src(['!public/javascripts/vendor/**/*.js', 'public/javascripts/**/app.js', 'public/javascripts/**/*.js'])
.pipe(concat('/public/application.js'))
.pipe(gulp.dest('.'))
gulp.src(['public/javascripts/vendor/**/*.js'])
.pipe(concat('/public/vendor.js'))
.pipe(gulp.dest('.'))
})
gulp.task('join_css', function() {
gulp.src(['public/stylesheets/**/imports.css', 'public/stylesheets/**/*.css'])
.pipe(concat('/public/style.css'))
.pipe(gulp.dest('.'))
})
gulp.task('minify_js', function() {
gulp.src(['!public/javascripts/vendor/**/*.js', 'public/javascripts/**/app.js', 'public/javascripts/**/*.js'])
.pipe(concat('/public/application.js'))
.pipe(uglify())
.pipe(gulp.dest('.'))
gulp.src(['public/javascripts/vendor/**/*.js'])
.pipe(concat('/public/vendor.js'))
.pipe(uglify())
.pipe(gulp.dest('.'))
})
gulp.task('minify_css', function() {
gulp.src(['public/stylesheets/**/imports.css', 'public/stylesheets/**/*.css'])
.pipe(concat('/public/style.css'))
.pipe(minifyCss())
.pipe(gulp.dest('.'))
})
gulp.task('dev', function() {
gulp.start('join_js', 'join_css')
nodemon({
script: 'app.js',
ext: 'js css',
ignore: ['public/application.js', 'public/style.css', 'public/vendor.js'],
tasks: ['join_js', 'join_css'],
args: ['dev']
})
})
gulp.task('build', function() {
gulp.start('minify_js', 'minify_css')
})