-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
67 lines (60 loc) · 1.24 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
const { src,
dest,
// parallel,
series,
task,
watch } = require('gulp')
const auto = require('autoprefixer'),
color = require('postcss-colorblind'),
cssnano = require('cssnano'),
magic = require('postcss-font-magician'),
maps = require('gulp-sourcemaps'),
post = require('gulp-postcss'),
rename = require('gulp-rename'),
stylus = require('gulp-stylus'),
// svgo = require('postcss-svgo'),
ugly = require('gulp-terser-js')
const path = {
styles: {
src: './sources/stylus/theme.styl',
dest: './assets/css/'
},
scripts: {
src: './sources/javascript/theme.js',
dest: './assets/js/'
}
}
function styles () {
const processors = [
auto,
color,
magic,
// svgo,
cssnano,
]
return src(path.styles.src)
.pipe(maps.init())
.pipe(stylus({
use: [
]
}))
.pipe(post(processors))
.pipe(rename('wellspring.css'))
.pipe(maps.write('./'))
.pipe(dest(path.styles.dest));
}
function scripts () {
return src(path.scripts.src)
.pipe(ugly({
mangle: {
toplevel: true
}
}))
.pipe(rename('wellspring.js'))
.pipe(dest(path.scripts.dest));
}
task('watch', () => {
watch('**/*.styl', styles)
watch('**/*.js', scripts)
});
task('default', series(styles, scripts, ['watch']));