-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
30 lines (27 loc) · 944 Bytes
/
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
/**
* Created by Administrator on 2015/10/27.
*/
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps');
gulp.task('script', function () {
gulp.src(['./libs/jquery-2.1.4.js','./libs/vue.js','./libs/ZeroClipboard.min.js','./js/common.js','./js/smb.js'])
.pipe(concat('all.js'))
.pipe(gulp.dest('./build/'))
.pipe(rename({suffix:'.min'}))
.pipe(uglify())
.pipe(gulp.dest('./build/'));
});
gulp.task('sass', function () {
gulp.src('./sass/*.scss')
.pipe(sass({outputStyle: 'compressed'}).on('error',sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./css'))
});
gulp.task('default',['script','sass'], function () {
gulp.watch('./js/*.js',['script']);
gulp.watch('./sass/*.scss',['sass']);
});