-
Notifications
You must be signed in to change notification settings - Fork 1
/
config-overrides.js
44 lines (36 loc) · 1.04 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
const rewireReactHotLoader = require('react-app-rewire-hot-loader')
const Dotenv = require('dotenv-webpack');
const WebpackBar = require('webpackbar');
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = function override(webpackConfig, env) {
// enable Hot Module Replacement
webpackConfig = rewireReactHotLoader(webpackConfig, env);
// set aliases
webpackConfig.resolve.alias = {
...webpackConfig.resolve.alias,
//'react-dom$': '@hot-loader/react-dom'
};
// disable source maps
//webpackConfig.devtool = 'none';
// disable linter
webpackConfig.module.rules[1] = {};
// load mjs modules
webpackConfig.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
});
// plugins
webpackConfig.plugins.push(
// new BundleAnalyzerPlugin(),
new Dotenv(),
new WebpackBar({
name: '📦 PRIVI Bundler',
color: "green",
minimal: false,
profile: true,
fancy: true
})
);
return webpackConfig;
}