forked from Tencent/weui-wxss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
24 lines (22 loc) · 864 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
var gulp = require('gulp');
var less = require('gulp-less');
var rename = require('gulp-rename');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
gulp.task('watch', function(){
gulp.watch('src/**', ['build:style', 'build:example']);
});
gulp.task('build:style', function(){
gulp.src(['src/style/**/*.wxss', 'src/example/*.wxss'], {base: "src"})
.pipe(less())
.pipe(postcss([autoprefixer(['iOS >= 8', 'Android >= 4.1'])]))
.pipe(rename(function(path){
path.extname = '.wxss';
}))
.pipe(gulp.dest('dist'));
});
gulp.task('build:example', function(){
gulp.src(['src/app.js', 'src/app.json', 'src/app.wxss', 'src/example/**', '!src/example/*.wxss'], {base: "src"})
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['watch', 'build:style', 'build:example']);