Skip to content

Commit

Permalink
update webpack.config to load CSS order correctly (#12484)
Browse files Browse the repository at this point in the history
  • Loading branch information
framitdavid authored Mar 12, 2024
1 parent 056a2df commit aa6097f
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions frontend/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,37 @@ module.exports = {
use: ['@svgr/webpack'],
},
{
test: /\.module\.css$/,
test: /(?<!\.module)\.css$/,
use: [
'style-loader',
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader',
options: {
url: {
filter: (url, _resourcePath) => {
// Disable processing for root-relative urls (e.g. /designer/img)
return !/^\//.test(url);
},
},
modules: {
localIdentName: '[name]__[local]--[hash:base64:5]',
},
url: false,
},
},
],
},
{
test: /(?<!\.module)\.css$/,
test: /\.module\.css$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader',
options: {
url: false,
url: {
filter: (url, _resourcePath) => {
// Disable processing for root-relative urls (e.g. /designer/img)
return !/^\//.test(url);
},
},
modules: {
localIdentName: '[name]__[local]--[hash:base64:5]',
},
},
},
],
Expand Down

0 comments on commit aa6097f

Please sign in to comment.