-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
50 lines (46 loc) · 1.19 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
const {
override,
addBabelPlugin,
addDecoratorsLegacy,
addBundleVisualizer,
addWebpackModuleRule,
addWebpackAlias,
adjustWorkbox,
useBabelRc,
} = require("customize-cra");
const path = require("path");
module.exports = override(
useBabelRc(),
// enable legacy decorators babel plugin
addDecoratorsLegacy(),
// add webpack bundle visualizer if BUNDLE_VISUALIZE flag is enabled
process.env.BUNDLE_VISUALIZE == 1 && addBundleVisualizer(),
// add an alias for "ag-grid-react" imports
addWebpackAlias({
["ag-grid-react$"]: path.resolve(__dirname, "src/shared/agGridWrapper.js")
}),
// adjust the underlying workbox
adjustWorkbox(wb =>
Object.assign(wb, {
skipWaiting: true,
exclude: (wb.exclude || []).concat("index.html")
})
),
addWebpackModuleRule({
test: /\.jsx?$/,
include: [
'node_modules/@salesforce/design-system-react',
].map(
someDir => path.resolve(
process.cwd(),
someDir
)
),
loader: require.resolve('babel-loader'),
options: {
presets: [
"react-app"
],
},
}),
);