-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
46 lines (45 loc) · 1.43 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
const { ProvidePlugin } = require('webpack');
module.exports = function (config, env) {
return {
...config,
module: {
...config.module,
rules: [
...config.module.rules,
{
test: /\.m?[jt]sx?$/,
enforce: 'pre',
use: ['source-map-loader'],
},
{
test: /\.m?[jt]sx?$/,
resolve: {
fullySpecified: false,
},
},
],
},
plugins: [
...config.plugins,
new ProvidePlugin({
buffer:['buffer', 'Buffer'],
process: 'process/browser',
}),
],
resolve: {
...config.resolve,
fallback: {
assert: require.resolve('assert'),
buffer: require.resolve('buffer'),
crypto: require.resolve('crypto-browserify'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
stream: require.resolve('stream-browserify'),
vm: require.resolve('vm-browserify'),
url: require.resolve('url/'),
zlib: require.resolve('browserify-zlib'),
},
},
ignoreWarnings: [/Failed to parse source map/],
};
};