add projectroot to sass includedPaths instead of using replace to fix the paths during build

This commit is contained in:
Art Lowel
2019-06-05 17:14:22 +02:00
parent 56b2ee1f0d
commit 743be6a2cd
18 changed files with 21 additions and 76 deletions

View File

@@ -1,24 +0,0 @@
const replace = require('replace-in-file');
const path = require('path');
const {
projectRoot,
} = require('../webpack/helpers');
/**
* This script ensures you can use ~ to reference the project dir
* in scss imports for AoT builds as well.
*/
const options = {
files: path.join(projectRoot('build'), '**', '*.scss'),
from: /@import '~\/([^']+)/g,
to: `@import '${path.join(projectRoot('./'), '$1')}`,
};
try {
replace.sync(options);
}
catch (error) {
console.error('Error occurred:', error);
}