Skip to content

Commit

Permalink
fix issues with path separators in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
artlowel committed Apr 2, 2021
1 parent 8730676 commit fb634cd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/styles/_mixins.scss
@@ -1,4 +1,3 @@
@import '../../node_modules/bootstrap/scss/functions.scss';
@import '../../node_modules/bootstrap/scss/mixins.scss';

@mixin word-wrap() {
Expand Down
4 changes: 2 additions & 2 deletions webpack/helpers.ts
Expand Up @@ -6,8 +6,8 @@ export const projectRoot = (relativePath) => {

export const globalCSSImports = () => {
return [
projectRoot('src/styles/_variables.scss'),
projectRoot('src/styles/_mixins.scss'),
projectRoot(path.join('src', 'styles', '_variables.scss')),
projectRoot(path.join('src', 'styles', '_mixins.scss')),
];
};

Expand Down
8 changes: 5 additions & 3 deletions webpack/webpack.common.ts
Expand Up @@ -17,7 +17,9 @@ export const copyWebpackOptions = {
to: 'assets',
},
{
from: path.join(__dirname, '..', 'src', 'themes', '*', 'assets', '**', '*'),
// replace(/\\/g, '/') because glob patterns need forward slashes, even on windows:
// https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows
from: path.join(__dirname, '..', 'src', 'themes', '*', 'assets', '**', '*').replace(/\\/g, '/'),
to: 'assets',
noErrorOnMissing: true,
transformPath(targetPath, absolutePath) {
Expand Down Expand Up @@ -77,7 +79,7 @@ export const commonExports = {
test: /\.scss$/,
exclude: [
/node_modules/,
/(_exposed)?_variables.scss$|\/src\/themes\/[^/]+\/styles\/.+.scss$/
/(_exposed)?_variables.scss$|[\/|\\]src[\/|\\]themes[\/|\\].+?[\/|\\]styles[\/|\\].+\.scss$/
],
use: [
...SCSS_LOADERS,
Expand All @@ -90,7 +92,7 @@ export const commonExports = {
]
},
{
test: /(_exposed)?_variables.scss$|\/src\/themes\/[^/]+\/styles\/.+.scss$/,
test: /(_exposed)?_variables.scss$|[\/|\\]src[\/|\\]themes[\/|\\].+?[\/|\\]styles[\/|\\].+\.scss$/,
exclude: [/node_modules/],
use: [
...SCSS_LOADERS,
Expand Down

0 comments on commit fb634cd

Please sign in to comment.