This repository was archived by the owner on Nov 23, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.config.js
More file actions
45 lines (42 loc) · 1.22 KB
/
webpack.config.js
File metadata and controls
45 lines (42 loc) · 1.22 KB
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
const webpack = require('webpack');
const { join } = require('path');
const nrwlConfig = require('@nrwl/react/plugins/webpack.js');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const CompressionPlugin = require('compression-webpack-plugin');
module.exports = (config) => {
nrwlConfig(config);
return {
...config,
plugins: [
...config.plugins,
new NodePolyfillPlugin(),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
process: 'process/browser',
}),
new CompressionPlugin(),
// new BundleAnalyzerPlugin({ analyzerMode: 'static' })
],
optimization: {
mergeDuplicateChunks: true,
minimize: true,
moduleIds: 'size',
nodeEnv: 'production',
},
resolve: {
fallback: {
util: require.resolve('util'),
process: 'process/browser',
'@dstack-js/lib': join(__dirname, 'dist', 'packages', 'lib'),
'@dstack-js/ipfs': join(__dirname, 'dist', 'packages', 'ipfs'),
'@dstack-js/transport': join(
__dirname,
'dist',
'packages',
'transport'
),
},
},
};
};