From 0336c4aef450e0e4858836bd2adf1705b808b419 Mon Sep 17 00:00:00 2001 From: sami-t Date: Mon, 14 Jul 2014 17:39:01 -0700 Subject: [PATCH] Build .less file when relevant .overrides or .variables file is modified --- src/Gruntfile.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Gruntfile.js b/src/Gruntfile.js index eb5219c94..e2e7eea29 100644 --- a/src/Gruntfile.js +++ b/src/Gruntfile.js @@ -64,6 +64,13 @@ module.exports = function(grunt) { if(process.platform === 'win32') { filePath = filePath.replace(/\\/g, '/'); } + var + re = new RegExp(paths.source.themes + '.*\/([^\/]*\/[^\/]*)\.(?:overrides|variables)$') + ; + // find relevant .less file for each modified .overrides or .variables file + if(filePath.search(re) !== -1) { + filePath = filePath.replace(re, paths.source.definitions + '$1.less'); + } var outputPath = filePath.replace(paths.source.definitions, paths.output.uncompressed + 'definitions/') ;