-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
63 lines (54 loc) · 1.62 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
56
57
58
59
60
61
62
63
'use strict';
const gulp = require('gulp');
const plugins = require('gulp-load-plugins')();
const argv = require('yargs').argv;
const resources = [
'./javascripts/vendor/jquery-2.1.1.min.js',
'./nyc-zone-data/manhattan.js',
'./nyc-zone-data/brooklyn.js',
'./nyc-zone-data/queens.js',
'./nyc-zone-data/thebronx.js',
'./nyc-zone-data/statenisland.js',
'./nyc-zone-data/boroughs.js',
'./javascripts/boroughBoxes.js',
'./javascripts/consoleArt.js',
'./javascripts/controls.js',
'./javascripts/form.js',
'./javascripts/main.js',
'./javascripts/map.js',
'./javascripts/util.js',
'./javascripts/zoner.js',
'./javascripts/templates.js',
];
gulp.task('eslint', () => {
return gulp.src(resources)
.pipe(plugins.eslint())
.pipe(plugins.eslint.format())
.pipe(plugins.eslint.failAfterError());
});
gulp.task('js', () => {
return gulp.src(resources)
.pipe(plugins.babel({
presets: ['@babel/env']
}))
.pipe(plugins.concat('application.js'))
.pipe(gulp.dest('.'));
});
gulp.task('js-compress', () => {
return gulp.src(resources)
.pipe(plugins.babel({
presets: ['@babel/env']
}))
.pipe(plugins.concat('application.js'))
.pipe(plugins.uglifyEs.default())
.pipe(gulp.dest('.'));
});
gulp.task('sass', () => {
return gulp.src('./sass/*.scss')
.pipe(plugins.sass({outputStyle: 'compressed'}).on('error', plugins.sass.logError))
.pipe(gulp.dest('.'));
});
gulp.task('default', gulp.parallel('js', 'sass'));
// gulp.watch(resources, gulp.parallel('js'));
// gulp.watch('sass/', gulp.parallel('sass'));
gulp.task('production', gulp.parallel('js-compress', 'sass'));