-
Notifications
You must be signed in to change notification settings - Fork 26
/
config-overrides.js
41 lines (39 loc) · 1.64 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
const webpack = require('webpack');
module.exports = function override(config, env) {
config.externals = ['pg', 'tedious', 'pg-hstore'];
config.target = 'electron-renderer';
config.resolve.fallback = {
//assert: require.resolve('assert'),
//buffer: require.resolve('buffer'),
//console: require.resolve('console-browserify'),
//constants: require.resolve('constants-browserify'),
//crypto: require.resolve('crypto-browserify'),
//domain: require.resolve('domain-browser'),
//events: require.resolve('events'),
//http: require.resolve('stream-http'),
//https: require.resolve('https-browserify'),
//os: require.resolve('os-browserify/browser'),
path: require.resolve('path-browserify'),
//punycode: require.resolve('punycode'),
//process: require.resolve('process/browser'),
//querystring: require.resolve('querystring-es3'),
//stream: require.resolve('stream-browserify'),
//string_decoder: require.resolve('string_decoder'),
//sys: require.resolve('util'),
//timers: require.resolve('timers-browserify'),
//tty: require.resolve('tty-browserify'),
//url: require.resolve('url'),
//util: require.resolve('util'),
//vm: require.resolve('vm-browserify'),
//zlib: require.resolve('browserify-zlib'),
fs: require.resolve('fs'),
"electron-is-dev": require.resolve('electron-is-dev')
};
config.plugins.push(
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
}),
);
return config;
}