-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
39 lines (37 loc) · 1.52 KB
/
gulpfile.js
File metadata and controls
39 lines (37 loc) · 1.52 KB
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
const
{src, dest, watch, parallel, series} = require('gulp'),
// prefixer = require('gulp-autoprefixer'),
// uglify = require('gulp-uglify'),
fileinclude = require('gulp-file-include')
;
const PATH = {
build: { //Тут мы укажем куда складывать готовые после сборки файлы
html: 'dist/',
js: 'dist/js/',
css: 'dist/css/',
img: 'dist/img/',
fonts: 'dist/fonts/'
},
src: { //Пути откуда брать исходники
html: 'src/*.html', //Синтаксис src/*.html говорит gulp что мы хотим взять все файлы с расширением .html
js: 'src/js/*.js',
style: 'src/styles/*.css',
img: 'src/img/**/*.*', //Синтаксис img/**/*.* означает - взять все файлы всех расширений из папки и из вложенных каталогов
fonts: 'src/fonts/**/*.*'
},
watch: { //Тут мы укажем, за изменением каких файлов мы хотим наблюдать
// html: 'public/index.html',
js: 'main_page/front_src/js/**/*.js',
style: 'main_page/front_src/sass/**/*.scss',
img: 'main_page/front_src/img/**/*.*',
fonts: 'main_page/front_src/fonts/**/*.*'
}
};
exports.buildhtml = function() {
return src(PATH.src.html)
.pipe(fileinclude({
prefix: '@@',
basepath: '@file'
}))
.pipe(dest(PATH.build.html));
};