changed replace regexes to be windows compatible

This commit is contained in:
lotte
2019-06-05 15:30:46 +02:00
parent ed128d1f17
commit d305adaa07
2 changed files with 6 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
const replace = require('replace-in-file');
const path = require('path');
const {
projectRoot,
} = require('../webpack/helpers');
@@ -10,9 +11,9 @@ const {
const options = {
files: projectRoot('build') + '/**/*.scss',
from: /@import '~\//g,
to: `@import '${projectRoot('./')}/`,
files: path.join(projectRoot('build'), '**', '*.scss'),
from: /@import '~\/([^']+)/g,
to: `@import '${path.join(projectRoot('./'), '$1')}`,
};
try {

View File

@@ -9,7 +9,6 @@ const projectRoot = (relativePath) => {
const srcPath = projectRoot('src');
const buildRoot = (relativePath, env) => {
console.log(env.aot);
if (env.aot) {
return path.resolve(projectRoot('./build'), relativePath);
} else {
@@ -68,8 +67,8 @@ const themeReplaceOptions =
{
multiple: [
{
search: '@import \'~/',
replace: '@import \'' + projectRoot('./') + '/',
search: '@import \'~/([^\']+)',
replace: '@import \'' + path.join(projectRoot('./'), '$1'),
flags: 'g'
}
]