From 6d64aa7d3ee34eeb6b92939416ac261c58c05133 Mon Sep 17 00:00:00 2001 From: Colin Frick Date: Mon, 8 Apr 2019 13:14:45 +0200 Subject: [PATCH] build(css): watch task didn't update files that depends on site.variable If changes are detected in the site.variables file, all css files should be rebuilt. Closes #631 --- tasks/build/css.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tasks/build/css.js b/tasks/build/css.js index a34c9a9627..f549c44500 100644 --- a/tasks/build/css.js +++ b/tasks/build/css.js @@ -192,7 +192,10 @@ module.exports.watch = function (type, config) { const method = type === 'docs' ? docs : rtlAndNormal; // Watch theme.config file - gulp.watch([normalize(config.paths.source.config)]) + gulp.watch([ + normalize(config.paths.source.config), + normalize(config.paths.source.site + '/**/site.variables') + ]) .on('all', function () { // Clear timeout and reset files timeout && clearTimeout(timeout); @@ -217,7 +220,9 @@ module.exports.watch = function (type, config) { // Determine which LESS file has to be recompiled let lessPath; - if (path.indexOf(config.paths.source.themes) !== -1) { + if(path.indexOf('site.variables') !== -1) { + return; + } else if (path.indexOf(config.paths.source.themes) !== -1) { console.log('Change detected in packaged theme'); lessPath = replaceExt(path, '.less'); lessPath = lessPath.replace(tasks.regExp.theme, config.paths.source.definitions);