Commit c0fbe085 authored by Nikolay Gromov's avatar Nikolay Gromov

Добавления к автоматизации

parent 8983611c
...@@ -310,12 +310,18 @@ function serve() { ...@@ -310,12 +310,18 @@ function serve() {
notify: false, notify: false,
}); });
// Конфигурационный файл
watch([`config.js`], { events: ['change'], delay: 100 }, series(
parallel(writeSassImportsFile, writeJsRequiresFile),
parallel(compileSass, buildJs),
reload
));
// Страницы: изменение, добавление // Страницы: изменение, добавление
watch([`${dir.src}pages/**/*.pug`], { events: ['change', 'add'], delay: 100 }, series( watch([`${dir.src}pages/**/*.pug`], { events: ['change', 'add'], delay: 100 }, series(
compilePugFast, compilePugFast,
parallel(writeSassImportsFile, writeJsRequiresFile), parallel(writeSassImportsFile, writeJsRequiresFile),
parallel(compileSass, buildJs), parallel(compileSass, buildJs),
// buildJsLibrary,
reload reload
)); ));
...@@ -323,18 +329,23 @@ function serve() { ...@@ -323,18 +329,23 @@ function serve() {
watch([`${dir.src}pages/**/*.pug`], { delay: 100 }) watch([`${dir.src}pages/**/*.pug`], { delay: 100 })
// TODO попробовать с events: ['unlink'] // TODO попробовать с events: ['unlink']
.on('unlink', function(path, stats) { .on('unlink', function(path, stats) {
let filePathInBuildDir = path.replace(dir.src + 'pages/', dir.build).replace('.pug', '.html'); let filePathInBuildDir = path.replace(`${dir.src}pages/`, dir.build).replace('.pug', '.html');
fs.unlink(filePathInBuildDir, (err) => { fs.unlink(filePathInBuildDir, (err) => {
if (err) throw err; if (err) throw err;
console.log(`---------- Delete: ${filePathInBuildDir}`); console.log(`---------- Delete: ${filePathInBuildDir}`);
}); });
}); });
// Разметка Блоков: изменение, добавление // Разметка Блоков: изменение
watch([`${dir.blocks}**/*.pug`], { events: ['change', 'add'], delay: 100 }, series( watch([`${dir.blocks}**/*.pug`], { events: ['change'], delay: 100 }, series(
compilePug,
reload
));
// Разметка Блоков: добавление
watch([`${dir.blocks}**/*.pug`], { events: ['add'], delay: 100 }, series(
writePugMixinsFile,
compilePug, compilePug,
writeSassImportsFile,
compileSass,
reload reload
)); ));
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
@import "../table/table.scss"; @import "../table/table.scss";
@import "../table-responsive/table-responsive.scss"; @import "../table-responsive/table-responsive.scss";
@import "../tabs/tabs.scss"; @import "../tabs/tabs.scss";
@import "../social/social.scss";
@import "../to-top/to-top.scss"; @import "../to-top/to-top.scss";
@import "../../scss/print.scss"; @import "../../scss/print.scss";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment