mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
25 lines
514 B
JavaScript
25 lines
514 B
JavaScript
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);
|
|
}
|