forked from nativefier/nativefier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
65 lines (61 loc) · 1.42 KB
/
webpack.config.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var electronPublicApi = [
'electron',
// for modules which use deprecated api
// modules are taken from https://github.com/atom/electron/tree/master/docs/api
'app',
'screen'
// Uncomment as needed if some external module uses the deprecated api
// 'accelerator',
// 'auto-updater',
// 'browser-window',
// 'chrome-command-line-switches',
// 'clipboard',
// 'content-tracing',
// 'crash-reporter',
// 'desktop-capturer',
// 'dialog',
// 'download-item',
// 'environment-variables',
// 'file-object',
// 'frameless-window',
// 'global-shortcut',
// 'ipc-main',
// 'ipc-renderer',
// 'menu-item',
// 'menu',
// 'native-image',
// 'power-monitor',
// 'power-save-blocker',
// 'process',
// 'protocol',
// 'remote',
// 'session',
// 'shell',
// 'synopsis',
// 'tray',
// 'web-contents',
// 'web-frame',
// 'web-view-tag',
// 'window-open'
];
var nodeModules = {};
electronPublicApi.forEach(apiString => {
nodeModules[apiString] = 'commonjs ' + apiString;
});
module.exports = {
target: 'node',
output: {
filename: 'main.js'
},
node: {
global: false,
__dirname: false
},
externals: nodeModules,
module: {
loaders: [
{test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'}
]
},
devtool: 'source-map'
};