Skip to content

Commit

Permalink
build(css): watch task didn't update files that depends on site.variable
Browse files Browse the repository at this point in the history
If changes are detected in the site.variables file, all css files should be rebuilt.

Closes #631
  • Loading branch information
ColinFrick authored and Sean committed Apr 8, 2019
1 parent dcf3976 commit 6d64aa7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tasks/build/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 6d64aa7

Please sign in to comment.