-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
38 lines (37 loc) · 973 Bytes
/
Copy pathgulpfile.js
File metadata and controls
38 lines (37 loc) · 973 Bytes
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
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
//less = require('gulp-less'),
//concat = require('gulp-concat'),
//uglify = require('gulp-uglify'),
connect = require('gulp-connect'),
path = {
LESS: './src/*.less',
//CSS: './web/css/*.css',
CSS: './js/*.css',
//HTML: './*.html',
HTML: './js/*.html',
//JS: './web/js/*.js'
JS: './js/*.js'
};
gulp.task('server',function(){
connect.server({
root: './',
port: 802,
livereload: true
});
})
//处理js文件
//gulp.task('scriptHandle',function(){
// gulp.src(path.JS).pipe(uglify({
// mangle: {except: ['require','exports','module','$']}//排除混淆关键字
// })).pipe(gulp.dest('dest/js'));
//});
gulp.task('watch',function(){
gulp.watch(path.CSS,['reload']);
gulp.watch(path.HTML,['reload']);
gulp.watch(path.JS,['reload']);
});
gulp.task('reload',function () {
gulp.src('./*.html').pipe(connect.reload());
});
gulp.task('default',['watch','server']);