From 9a7ec57c181cc43c0e182c00ae7f1a851e045083 Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Sun, 17 Mar 2019 11:00:30 +0000 Subject: [PATCH] Resolve partials properly --- core/src/main.js | 5 ++++- tests/ext/themes/Example/{vars.scss => _vars.scss} | 0 2 files changed, 4 insertions(+), 1 deletion(-) rename tests/ext/themes/Example/{vars.scss => _vars.scss} (100%) diff --git a/core/src/main.js b/core/src/main.js index edb1e739d..fc8fd3601 100644 --- a/core/src/main.js +++ b/core/src/main.js @@ -90,7 +90,10 @@ class Comms { const sassImporter = async (context, url, prev, inlinedFiles) => { let file = path.resolve(path.dirname(prev), url); - const scss = await FileUtils.readFile(file).catch(err => FileUtils.readFile(file += '.scss')); + const scss = await FileUtils.readFile(file) + .catch(err => FileUtils.readFile(file += '.scss')) + .catch(err => FileUtils.readFile(file = path.join(path.dirname(file), '_' + path.basename(file).substr(0, path.basename(file).length - 5)))) + .catch(err => FileUtils.readFile(file += '.scss')); const result = await postcss([postcssUrl({url: 'inline', encodeType: 'base64', optimizeSvgEncode: true})]) .process(scss, {from: file, syntax: postcssScss}); diff --git a/tests/ext/themes/Example/vars.scss b/tests/ext/themes/Example/_vars.scss similarity index 100% rename from tests/ext/themes/Example/vars.scss rename to tests/ext/themes/Example/_vars.scss