forked from bravf/VueUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
45 lines (38 loc) · 1001 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// 引入 gulp
var gulp = require('gulp');
// 引入组件
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
// 检查脚本
gulp.task('lint', function() {
gulp.src('./src/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// 合并css文件
gulp.task('csss', function() {
gulp.src('./src/**/*.css')
.pipe(concat('vueUI.css'))
.pipe(gulp.dest('./dist'));
});
// 合并js文件
gulp.task('scripts', function() {
gulp.src('./src/**/*.js')
.pipe(concat('vueUI.js'))
.pipe(gulp.dest('./dist'));
});
// 默认任务
gulp.task('default', function(){
gulp.run('csss', 'scripts');
// 监听文件变化
gulp.watch('./src/**/*.js', function(){
gulp.run('scripts');
});
// 监听文件变化
gulp.watch('./src/**/*.css', function(){
gulp.run('csss');
});
});