{
test: /\.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader', options: { modules: true } },
],
},
options: { modules: true }
const cssRegex = /\.css$/;
const cssModuleRegex = /\.module\.css$/;
{
test: cssRegex,
exclude: cssModuleRegex,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
},
{
test: cssModuleRegex,
use: [{ loader: 'style-loader' },
{
loader: 'css-loader',
options: {
modules: true,
},
},
],
},
{
test: /\.css$/,
oneOf: [{
resourceQuery: /no-module/,
use: [{loader: 'style-loader'}, {loader: 'css-loader'}]
}, {
use: [{loader: 'style-loader'}, {loader: 'css-loader', options: {modules: true}}]
}]
}
{
test: /\.css$/,
oneOf: [{
resourceQuery: /module/,
use: [{loader: 'style-loader'}, {loader: 'css-loader', options: {modules: true}}]
}, {
use: [{loader: 'style-loader'}, {loader: 'css-loader'}]
}]
}