-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
26 lines (23 loc) · 857 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
const { series, watch } = require('gulp');
const browserSync = require('browser-sync').create('My Server');
const buildHtml = require('./gulp_tasks/html');
const buildCss = require('./gulp_tasks/css');
const uglifyJs = require('./gulp_tasks/js');
const buildSvgSprite = require('./gulp_tasks/svg');
const browserSyncJob = () => {
browserSync.init({ server: 'dist/' });
watch('src/**/*.pug', series(buildHtml, buildCss));
watch('src/scss/**/*.scss', buildCss);
watch(['src/js/**/*.js', '!src/js/_min/**/*.js'], series(uglifyJs, buildHtml));
};
const development = () => {
buildSvgSprite();
uglifyJs();
buildHtml();
buildCss();
browserSyncJob();
};
exports.server = browserSyncJob;
exports.build = series(buildSvgSprite, uglifyJs, buildHtml, buildCss);
exports.dev = development;
exports.buildSvgSprite = buildSvgSprite;