forked from chelorossi/hangremote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
55 lines (45 loc) · 1.23 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
43
44
45
46
47
48
49
50
51
52
53
54
55
/*global require exports*/
// using gulp 4
var gulp = require('gulp');
var minifyCSS = require('gulp-csso');
var minifyJS = require('gulp-uglify');
var eslint = require('gulp-eslint');
var del = require('del');
var paths = {
styles: {
src: 'src/css/*.css',
dest: 'build/src/css'
},
scripts: {
src: 'src/js/*.js',
dest: 'build/src/js'
}
};
function copyAssets() {
return gulp.src(['./manifest.json', './src/popup.html', 'icons/**'], {base: '.'}).
pipe(gulp.dest('./build/'));
}
function styles() {
return gulp.src(paths.styles.src). // path to your file
pipe(minifyCSS()).
pipe(gulp.dest(paths.styles.dest));
}
function clean() {
return del(['./build/']);
}
function lint() {
return gulp.src(paths.scripts.src). // path to your file
pipe(eslint()).
pipe(eslint.format()).
pipe(eslint.failAfterError());
}
function scripts () {
return gulp.src(paths.scripts.src). // path to your file
pipe(minifyJS()).
pipe(gulp.dest(paths.scripts.dest));
}
exports.clean = clean;
exports.styles = styles;
exports.scripts = scripts;
var build = gulp.series(clean, lint, gulp.parallel(styles, scripts, copyAssets));
gulp.task('default', build);