-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (29 loc) · 849 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
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const minify = require('gulp-minify');
const size = require('gulp-size');
const notify = require('gulp-notify');
const paths = {
dist: 'dist',
distIndex: 'dist/index.js',
distJS: 'dist/**/*.js',
};
gulp.task('default', ['lint'], () => {
// gulp.watch('js/**/*.js')
});
gulp.task('lint', () => gulp.src(['**/*.js', '!node_modules/**'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError()));
gulp.task('compress', () => {
gulp.src(['**/*.js'])
.pipe(minify({
ignoreFiles: ['node_modules/**', '.env', 'README.md', 'swagger.json'],
}))
.pipe(gulp.dest(paths.dist)).pipe(notify({
onLast: true,
message: () => 'finished compression',
}));
});
gulp.task('sizes', () => gulp.src('**/*.js')
.pipe(size({ showTotal: true, pretty: true })));