forked from EvergreenEducation/Evergreen-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rescriptsrc.js
49 lines (42 loc) · 1.29 KB
/
.rescriptsrc.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
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
const logConfig = (config) => {
return config;
};
logConfig.isMiddleware = true;
module.exports = [
['use-babel-config', 'babel.config.json'],
['use-eslint-config', '.eslintrc.json'],
['use-postcss-config'],
{
webpack: (config) => {
// if (config.mode === 'production') {
// config.plugins = [
// ...config.plugins,
// new BundleAnalyzerPlugin({
// analyzerMode: 'static',
// reportFilename: 'analyzed-bundle.html',
// }),
// ];
// }
config.plugins = [
...config.plugins,
new AntdDayjsWebpackPlugin(),
new LodashModuleReplacementPlugin({
shorthands: true,
collections: true,
paths: true,
cloning: true,
}),
];
config.entry = [...config.entry, 'react-hot-loader/patch', './src'];
config.resolve.alias = {
...config.resolve.alias,
'react-dom': '@hot-loader/react-dom',
};
return config;
},
},
logConfig,
];