-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
90 lines (77 loc) · 2.37 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
'use strict';
var gulp = require('gulp');
global.config = {
base: {
app: 'src/',
dist: 'dist/'
},
pathes: {
staticFiles: 'assets/{fonts,icons,img,animation}/**/*',
styles: ['./src/**/*.{css,scss}'],
scss: [
`./src/pages/home/home.scss`,
`./src/pages/rewards/rewards.scss`,
`./src/pages/airdrop/airdrop.scss`,
`./src/pages/airdrop2/airdrop2.scss`
],
mainJs: [
'./src/pages/home/home.js',
'./src/pages/rewards/rewards.js',
'./src/pages/airdrop/airdrop.js',
'./src/pages/airdrop2/airdrop2.js'
],
js: './src/**/*.js',
templates: './src/**/*.html',
pages: [
'./src/index.html',
'./src/rewards.html',
'./src/airdrop.html',
'./src/airdrop2.html'
]
},
namesWithHash: {
js: {
home: 'home.js',
rewards: 'rewards.js',
airdrop2: 'airdrop2.js',
airdrop: 'airdrop.js'
},
css: {
home: 'home.css',
rewards: 'rewards.css',
airdrop2: 'airdrop2.css',
airdrop: 'airdrop.css'
}
}
};
const preProcessPages = require('./gulp-tasks/process-pages');
const processJs = require('./gulp-tasks/process-js');
const processStyles = require('./gulp-tasks/process-styles');
const clean = require('./gulp-tasks/clean');
const copyStatic = require('./gulp-tasks/copy-static');
const develop = require('./gulp-tasks/develop-task');
const precommit = require('./gulp-tasks/precommit');
const browserify = require('./gulp-tasks/browserify');
gulp.task('clean', clean);
gulp.task('preProcessPages', preProcessPages);
gulp.task('processJs', processJs);
gulp.task('processStyles', processStyles);
gulp.task('copyStatic', copyStatic);
gulp.task('develop', develop);
gulp.task('precommit', precommit);
gulp.task('browserify', browserify);
console.log(process.env.NODE_ENV)
/**
* Task for prod environment.
*/
gulp.task('build', gulp.series(
'clean', gulp.parallel('processStyles', 'copyStatic', 'processJs'),
gulp.parallel('preProcessPages')
));
/**
* Task for dev environment.
*/
gulp.task('default', gulp.series(
'clean', gulp.parallel('processStyles', 'copyStatic', 'preProcessPages'),
gulp.parallel('processJs', 'develop', 'browserify')
));