-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.js
38 lines (37 loc) · 958 Bytes
/
craco.config.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
const CracoAlias = require("craco-alias");
module.exports = {
webpack: {
configure: (webpackConfig, { env, paths }) => {
const reactAppEnv = process.env.REACT_APP_ENV;
if (reactAppEnv === "dev" || reactAppEnv === "stage") {
webpackConfig.optimization.minimize = false;
webpackConfig.devtool = "source-map";
} else {
webpackConfig.devtool = false;
}
return webpackConfig;
},
},
style: {
css: {
loaderOptions: () => ({
url: {
filter: (url) => url.includes("/fonts/"),
},
}),
},
},
plugins: [
{
plugin: CracoAlias,
options: {
source: "tsconfig",
// baseUrl SHOULD be specified
// plugin does not take it from tsconfig
baseUrl: ".",
// tsConfigPath should point to the file where "baseUrl" and "paths" are specified
tsConfigPath: "./tsconfig.paths.json",
},
},
],
};