-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpFile.js
42 lines (34 loc) · 1.2 KB
/
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
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
del = require('del'),
less = require('gulp-less');
var angularPath = 'extension/contentScript/app/';
gulp.task('clean', function(cb) {
del([angularPath+'build/**/*', 'build/**/*', 'dist/**/*'], cb);
});
gulp.task('compileLess', function() {
return gulp.src(angularPath+'less/main.less')
.pipe(less())
.pipe(gulp.dest(angularPath+'build'));
});
gulp.task('autoprefix', ['compileLess'], function () {
return gulp.src(angularPath+'build/main.css')
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest(angularPath+'build/'));
});
gulp.task('watch', function() {
gulp.watch('less/**/*.less', ['less']);
});
gulp.task('less', ['compileLess', 'autoprefix']);
gulp.task('build', ['clean', 'less'], function() {
gulp.src('./assets/**/*')
.pipe(gulp.dest('build/assets'));
gulp.src('./extension/**/*')
.pipe(gulp.dest('build/extension'));
gulp.src(['icon.png', 'config.json', 'manifest.json', 'package.json', 'license.txt'])
.pipe(gulp.dest('build/'));
});
gulp.task('default', ['clean', 'less']);