-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
31 lines (25 loc) · 908 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
const { src, dest, series, watch } = require('gulp');
const scss = require('gulp-sass')(require('sass'));
const prefixer = require('gulp-autoprefixer');
const cssMin = require('gulp-clean-css');
const jsMin = require('gulp-terser');
const stylesSource = './frontend/src/styles/**/*.scss';
const stylesDestination = './frontend/dist/styles/';
const scriptsSource = './frontend/src/scripts/**/*.js';
const scriptsDestination = './frontend/dist/scripts/';
const styles = () => {
return src(stylesSource)
.pipe(scss())
.pipe(prefixer('last 2 versions'))
.pipe(cssMin())
.pipe(dest(stylesDestination))
}
const scripts = () => {
return src(scriptsSource)
.pipe(jsMin())
.pipe(dest(scriptsDestination))
}
const watchTask = () => {
watch([stylesSource, scriptsSource], series(styles, scripts));
}
exports.default = series(styles, scripts, watchTask);