-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
41 lines (39 loc) · 927 Bytes
/
config-overrides.js
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
36
37
38
39
40
41
const {
override,
fixBabelImports,
addLessLoader,
addBabelPlugin
} = require("customize-cra");
const ImageminPlugin = require("imagemin-webpack-plugin").default;
const addImageMinPlugin = config => {
config.plugins.push(
new ImageminPlugin({
disable: process.env.NODE_ENV !== "production", // Disable during development
pngquant: {
quality: "95-100"
}
})
);
return config;
};
module.exports = override(
addBabelPlugin(["babel-plugin-styled-components", { displayName: true }]),
fixBabelImports("antd", {
libraryName: "antd",
libraryDirectory: "es",
style: true
}),
fixBabelImports("react-use", {
libraryName: "react-use",
libraryDirectory: "lib",
camel2DashComponentName: false
}),
addLessLoader({
javascriptEnabled: true,
modifyVars: {
"font-family": "Montserrat"
}
}),
addImageMinPlugin
// addBundleVisualizer()
);