forked from SocialGouv/archifiltre-mails
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.renderer.config.js
More file actions
35 lines (30 loc) · 1.17 KB
/
webpack.renderer.config.js
File metadata and controls
35 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const webpackCommonConfig = require("./webpack.common.config");
require("dotenv").config();
module.exports =
/** @param {import("webpack").Configuration} config */ function (config) {
const styleRules = config.module.rules.filter((rule) =>
rule.test.toString().match(/css|less|s\(\[ac\]\)ss/)
);
styleRules.forEach((rule) => {
const uses = rule.use;
if (!Array.isArray(uses)) {
return;
}
const cssLoader = uses.find((use) => use.loader === "css-loader");
if (typeof cssLoader === "object") {
cssLoader.options = {
...cssLoader.options,
esModule: true,
localsConvention: "camelCase",
modules: {
auto: (resourcePath) =>
!resourcePath.includes("ReactToastify.css"),
localIdentName: "[local]___[hash:base64:5]",
mode: "local",
},
sourceMap: true,
};
}
});
return webpackCommonConfig(config);
};