config.module.rules[2].oneOf.unshift(
{
test: /\.css$/,
include: /node_modules[\\/]antd-mobile/,
use: [
require.resolve("style-loader"),
{
loader: require.resolve("css-loader"),
options: {
modules:false
},
},
{
loader: require.resolve("postcss-loader"),
options: {
ident: "postcss",
plugins: () => [
require("postcss-flexbugs-fixes"),
autoprefixer({
browsers: [
">1%",
"last 4 versions",
"Firefox ESR",
"not ie < 9", // React doesn"t support IE8 anyway
],
flexbox: "no-2009",
}),
],
},
},
]
},
{
test: /\.css$/,
exclude: /node_modules[\\/]antd-mobile/,
use: [
require.resolve("style-loader"),
{
loader: require.resolve("css-loader"),
options: {
modules: true,
importLoaders: 1,
localIdentName: "[name]__[local]___[hash:base64:5]"
},
},
{
loader: require.resolve("postcss-loader"),
options: {
ident: "postcss",
plugins: () => [
require("postcss-flexbugs-fixes"),
autoprefixer({
browsers: [
">1%",
"last 4 versions",
"Firefox ESR",
"not ie < 9", // React doesn"t support IE8 anyway
],
flexbox: "no-2009",
}),
],
},
},
]
},
);