add syncbuilddir step to aot build

This commit is contained in:
Art Lowel
2019-05-31 09:44:49 +02:00
parent 32e7b7a3b4
commit d93173e8d2
25 changed files with 394 additions and 113 deletions

23
webpack/run-replace.js Normal file
View File

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