Skip to content

Commit

Permalink
Fix path resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelthomas2774 committed Mar 17, 2019
1 parent 90035c0 commit 6a38e8e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,16 @@ class Comms {
});

const sassImporter = async (context, url, prev) => {
const file = path.resolve(prev, url);
let file = path.resolve(path.dirname(prev), url);

console.log('Importing', file, url, prev, context);

const scss = await FileUtils.readFile(file);
const scss = await FileUtils.readFile(file).catch(err => FileUtils.readFile(file += '.scss'));

const result = await postcss([postcssUrl({url: 'inline', encodeType: 'base64', optimizeSvgEncode: true})])
.process(scss, {from: file, syntax: postcssScss});

console.log('Processed', file, result);

return {contents: result.css};
return {file, contents: result.css};
};

BDIpc.on('bd-compileSass', (event, options) => {
Expand Down

0 comments on commit 6a38e8e

Please sign in to comment.