-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
53 lines (47 loc) · 1.28 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 stylus = require('gulp-stylus');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var pjson = require('./package.json');
gulp.task('css:development', function() {
gulp.src('./assets/css/main.styl')
.pipe(stylus({
compress: false,
'include css': true
}))
.pipe(rename(pjson.name + '.css'))
.pipe(gulp.dest('./assets/dist/'));
});
gulp.task('css:production', function() {
gulp.src('./assets/css/main.styl')
.pipe(stylus({
compress: true,
'include css': true
}))
.pipe(rename(pjson.name + '.min.css'))
.pipe(gulp.dest('./assets/dist/'));
});
gulp.task('js:development', function() {
return gulp.src('assets/js/*.js')
.pipe(uglify({
compress: false
}))
.pipe(rename(pjson.name + '.js'))
.pipe(gulp.dest('./assets/dist'));
});
gulp.task('js:production', function() {
return gulp.src('assets/js/*.js')
.pipe(uglify())
.pipe(rename(pjson.name + '.min.js'))
.pipe(gulp.dest('./assets/dist'));
});
gulp.task('watch', function() {
gulp.watch('./assets/css/**/*.styl', ['css:development']);
gulp.watch('./assets/css/**/*.js', ['js:development']);
});
gulp.task('default', [
'js:production',
'css:production',
'js:development',
'css:development'
]);