-
Notifications
You must be signed in to change notification settings - Fork 10
/
config-overrides.js
28 lines (28 loc) · 1.15 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
//let NodePolyfillWebpackPlugin = require('node-polyfill-webpack-plugin');
let webpack = require('webpack');
module.exports = function override(config, env) {
//do stuff with the webpack config...
let fallback = {
fs: false,
crypto: require.resolve('crypto-browserify'),
path: require.resolve('path-browserify'),
//url: require.resolve('url'),
buffer: require.resolve('buffer/'),
//util: require.resolve('util/'),
stream: require.resolve('stream-browserify/'),
constants: require.resolve("constants-browserify"),
//vm: require.resolve('vm-browserify'),
zlib: require.resolve("browserify-zlib"),
console: require.resolve("console-browserify")
};
//console.log(config.resolve);
config.resolve.fallback = Object.assign({}, config.resolve.fallback, fallback);
//config.resolve.plugins.push(new NodePolyfillWebpackPlugin());
config.plugins = (config.plugins || []).concat([
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer']
})
])
return config;
}