-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
49 lines (40 loc) · 1.12 KB
/
Copy pathgulpfile.js
File metadata and controls
49 lines (40 loc) · 1.12 KB
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
var gulp = require('gulp'),
compass = require('gulp-compass'),
minifyCSS = require('gulp-minify-css'),
watch = require('gulp-watch'),
uglify = require('gulp-uglifyjs'),
sourcemaps = require('gulp-sourcemaps'),
plumber = require('gulp-plumber');
var conf = require('./conf/gulp.json');
gulp.task('style:build', function () {
gulp.src(conf.sassPath + conf.sassMainFileName)
.pipe(plumber())
.pipe(compass({
css: conf.cssPath,
sass: conf.sassPath,
image: conf.imagesPath,
style: 'expanded',
sourcemap: true
}));
});
gulp.task('js:build', function () {
gulp.src([conf.jsInitialSourcePath + '**/*.js', conf.jsSourcePath + '**/*.js'])
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(uglify(conf.jsMainFileName + '.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest(conf.jsPath));
});
gulp.task('build', [
'js:build',
'style:build',
]);
gulp.task('watch', function () {
watch([conf.sassPath + '**/*.scss'], function (event, cb) {
gulp.start('style:build');
});
watch([conf.jsSourcePath + '**/*.js'], function (event, cb) {
gulp.start('js:build');
});
});
gulp.task('default', ['build', 'watch']);