Resolve partials properly
This commit is contained in:
parent
d4ed8ad240
commit
9a7ec57c18
|
@ -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});
|
||||
|
|
Loading…
Reference in New Issue