Use backslashes to fix webpack build on windows (https://github.com/woocommerce/woocommerce-blocks/pull/6798)

* Use backslashes to fix webpack build on windows

* Update regex to use square brackets, and update copywebpack path for Windows

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
This commit is contained in:
Thomas Roberts 2022-11-02 10:24:19 +00:00 committed by GitHub
parent 27f9c746ea
commit 6f85ab593f
1 changed files with 6 additions and 4 deletions

View File

@ -227,7 +227,7 @@ const getMainConfig = ( options = {} ) => {
automaticNameDelimiter: '--',
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
test: /[\/\\]node_modules[\/\\]/,
name: 'wc-blocks-vendors',
chunks: 'all',
enforce: true,
@ -277,7 +277,6 @@ const getMainConfig = ( options = {} ) => {
if ( metadata.parent )
return `./inner-blocks/${ blockName }/block.json`;
return `./${ blockName }/block.json`;
},
},
@ -658,7 +657,7 @@ const getStylingConfig = ( options = {} ) => {
priority: 10,
},
vendorsStyle: {
test: /\/node_modules\/.*?style\.s?css$/,
test: /[\/\\]node_modules[\/\\].*?style\.s?css$/,
name: 'wc-blocks-vendors-style',
chunks: 'all',
priority: 7,
@ -676,7 +675,7 @@ const getStylingConfig = ( options = {} ) => {
module: {
rules: [
{
test: /\/node_modules\/.*?style\.s?css$/,
test: /[\/\\]node_modules[\/\\].*?style\.s?css$/,
use: [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { importLoaders: 1 } },
@ -731,6 +730,9 @@ const getStylingConfig = ( options = {} ) => {
if (
relativePath.startsWith(
'assets/css/abstracts/'
) ||
relativePath.startsWith(
'assets\\css\\abstracts\\'
)
) {
return content;