Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Commit c3e8c66

Browse files
author
ssidorenkoJustcoded
committed
gulp config file updated, pathes in tasks files updated
1 parent 7595f4e commit c3e8c66

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

gulp-config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
tasks: 'tasks',
44
src: 'src',
55
build: 'assets',
6-
prod: 'production',
6+
prod: 'production'
77
},
88
file: {
99
mainHtml: 'index.html',
@@ -15,6 +15,10 @@ module.exports = {
1515
vendorScss: 'vendor.scss',
1616
vendorScssMin: 'vendor.min.css',
1717
},
18+
fileInclude: {
19+
templates: 'src/html/templates',
20+
dest: './',
21+
},
1822
task: {
1923
htmlHint: 'html-hint',
2024
esLint: 'es-lint',

gulpfile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@
6969
* template HTML
7070
*/
7171

72-
requireTask(`${cfg.task.fileInclude}`, `./${cfg.folder.tasks}/`);
72+
requireTask(`${cfg.task.fileInclude}`, `./${cfg.folder.tasks}/`, {
73+
templates: cfg.fileInclude.templates,
74+
dest: cfg.fileInclude.dest
75+
});
7376

7477
/**
7578
* Hint HTML
@@ -213,6 +216,7 @@
213216
requireTask(`${cfg.task.watch}`, `./${cfg.folder.tasks}/`, {
214217
sassFilesInfo: cfg.getPathesForSassCompiling(),
215218
src: cfg.folder.src,
219+
templates: cfg.folder.templates,
216220
dest: cfg.folder.build,
217221
imageExtensions: cfg.imageExtensions,
218222
browserSync: browserSync,

tasks/file-include.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
const gulp = require('gulp'),
77
fileinclude = require('gulp-file-include')
88

9-
module.exports = function() {
9+
module.exports = function(options) {
1010

1111
return function() {
12-
return gulp.src('./src/html/templates/**/*.html')
12+
return gulp.src(`./${options.templates}/**/*.html`)
1313
.pipe(fileinclude({
1414
prefix: '@@',
15-
basepath: './src/html/templates'
15+
basepath: `./${options.templates}`
1616
}))
17-
.pipe(gulp.dest('./'));
17+
.pipe(gulp.dest(options.dest));
1818
};
1919

2020
};

0 commit comments

Comments
 (0)