forked from rai-project/mlmodelscope
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig-overrides.js
59 lines (54 loc) · 1.31 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const {
override,
addDecoratorsLegacy,
fixBabelImports,
disableEsLint,
addWebpackAlias,
addTslintLoader,
} = require("customize-cra");
const path = require("path");
function resolve(...dir) {
return path.join(__dirname, ...dir);
}
function resolveSrc(...dir) {
return path.join(__dirname, "src", ...dir);
}
function rewireSVGR(svgrLoaderOptions) {
return function (config) {
const svgReactLoader = {
test: /\.svg$/,
use: [
{
loader: require.resolve(`@svgr/webpack`),
options: svgrLoaderOptions,
},
{
loader: "url-loader",
},
],
};
config.module.rules.unshift(svgReactLoader);
return config;
};
}
const primaryColor = "#19263a";
module.exports = override(
addDecoratorsLegacy(),
disableEsLint(),
fixBabelImports("lodash", {
libraryName: "lodash",
libraryDirectory: "",
camel2DashComponentName: false, // default: true
}),
addWebpackAlias({
["@"]: resolve("src"),
["@components"]: resolveSrc("components"),
["@context"]: resolveSrc("context"),
["@routes"]: resolveSrc("routes"),
["@resources"]: resolveSrc("resources"),
["@icons"]: resolveSrc("resources", "icons"),
["@helpers"]: resolveSrc("helpers"),
["@common"]: resolveSrc("common"),
}),
addTslintLoader()
);