Fix all scss files rebuild on every non-js change
multimatch test was incorrect triggering scss rebuild on every change that reached that logic. Also fixed weird (legacy?) use of path.join()
This commit is contained in:
parent
c2ce5c7596
commit
32c0d228cc
2 changed files with 3 additions and 3 deletions
|
@ -33,13 +33,13 @@ async function getSass(source, options, signatures={}) {
|
|||
let newFileSignature = await getFileSignature(f);
|
||||
let destFile = getPathRelativeTo(f, 'scss');
|
||||
destFile = path.join(path.dirname(destFile), path.basename(destFile, '.scss') + '.css');
|
||||
let dest = path.join.apply(this, ['build', 'chrome', 'skin', 'default', 'zotero', destFile]);
|
||||
let dest = path.join('build', 'chrome', 'skin', 'default', 'zotero', destFile);
|
||||
|
||||
if (['win', 'mac', 'unix'].some(platform => f.endsWith(`-${platform}.scss`))) {
|
||||
let platform = f.slice(f.lastIndexOf('-') + 1, f.lastIndexOf('.'));
|
||||
destFile = destFile.slice(0, destFile.lastIndexOf('-'))
|
||||
+ destFile.slice(destFile.lastIndexOf('-') + 1 + platform.length);
|
||||
dest = path.join.apply(this, ['build', 'chrome', 'content', 'zotero-platform', platform, destFile]);
|
||||
dest = path.join('build', 'chrome', 'content', 'zotero-platform', platform, destFile);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -56,7 +56,7 @@ function getWatch() {
|
|||
return;
|
||||
}
|
||||
for (var i = 0; i < scssFiles.length; i++) {
|
||||
if (multimatch(path, scssFiles[i])) {
|
||||
if (multimatch(path, scssFiles[i]).length) {
|
||||
onSuccess(await getSass(scssFiles[i], { ignore: ignoreMask }));
|
||||
onSuccess(await cleanUp(signatures));
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue