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