-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
51 lines (44 loc) · 934 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const { series } = require('gulp');
const { ENV_DEVELOPMENT, ENV_PRODUCTION } = require('./tasks/helpers/config');
const scss = require('./tasks/scss');
const watch = require('./tasks/watch');
const rollup = require('./tasks/rollup');
const rollupGtm = require('./tasks/rollup-gtm');
const lintJs = require('./tasks/lint-js');
const lintScss = require('./tasks/lint-scss');
process.env.NODE_ENV = ENV_DEVELOPMENT;
const styles = function styles(done) {
return series(
lintScss,
scss,
)(done);
};
const build = function build(done) {
return series(
styles,
lintJs,
rollup,
rollupGtm,
)(done);
};
const dev = function dev(done) {
return series(
build,
watch,
)(done);
};
const prod = function min(done) {
process.env.NODE_ENV = ENV_PRODUCTION;
return series(
build,
)(done);
};
module.exports = {
build,
prod,
default: dev,
rollup,
rollupGtm,
lintJs,
styles,
}