When webpack is packaged, how to package without compiling css in node_modules?

encountered a problem, because using CSS Modules, to hash all the class names of the style, so as to avoid repetitive class name overwriting, but after doing so, the css introduced by the third-party library will also follow hash, but the class name on the page cannot follow hash because it was introduced like this by clssName="asss".

Baidu said that it was configured in webpack.config

.

config.module.rules.push ({
test: /. (sass | scss | css) $/,
loader: extractStyles.extract ({

)
fallback: "style-loader",
use: [
  {
    loader: "css-loader",
    options: {
      sourceMap: project.sourcemaps,
      exclude: [
        path.resolve(__dirname, "node_modules/react-quill")
      ],    //
      modules: true,
      localIdentName:"[path][name]__[local]--[hash:base64:5]",
    },
  },
  

but it has no effect. Build still comes out with the class name with hash.

like this

.node_modules-react-quill-dist-quill-snow__ql-snow--1csQY.node_modules-react-quill-dist-quill-snow__ql-toolbar--lFbPi button,
.node_modules-react-quill-dist-quill-snow__ql-snow--1csQY .node_modules-react-quill-dist-quill-snow__ql-toolbar--lFbPi button {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-block;
    float: left;
    height: .32rem;
    padding: .04rem .06667rem;
    width: .37333rem
}

what went wrong

Mar.13,2021
Menu