forked from IGS/portal-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-overrides.js
42 lines (36 loc) · 1 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
const { injectBabelPlugin } = require('react-app-rewired');
const rewireReactHotLoader = require('react-app-rewire-hot-loader');
const rewireSass = require('react-app-rewire-scss');
module.exports = function override(config, env) {
config = injectBabelPlugin(
[
'import-inspector',
{
serverSideRequirePath: false,
webpackRequireWeakId: true,
},
],
config,
);
config = injectBabelPlugin(
[
'relay',
{
compat: true,
schema: 'data/schema.graphql',
},
],
config,
);
config = rewireSass(config, env);
// config = rewireSass.withLoaderOptions(someLoaderOptions)(config, env);
// PLOTLY 3D
// config.module.rules = config.module.rules.concat({
// enforce: 'post',
// loader: ['ify-loader', 'transform-loader?plotly.js/tasks/compress_attributes.js'],
// test: /\.js$/,
// });
env === 'development' && (config.devtool = 'eval-source-map');
config = rewireReactHotLoader(config, env);
return config;
};