-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnextron.config.js
More file actions
42 lines (38 loc) · 1.36 KB
/
Copy pathnextron.config.js
File metadata and controls
42 lines (38 loc) · 1.36 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
module.exports = {
// // specify an alternate main src directory, defaults to 'main'
// mainSrcDir: 'main',
// // specify an alternate renderer src directory, defaults to 'renderer'
// rendererSrcDir: 'renderer',
// main process' webpack config
webpack: (config, env) => {
const optionalWsNativeDeps = {
bufferutil: "commonjs bufferutil",
"utf-8-validate": "commonjs utf-8-validate",
}
if (Array.isArray(config.externals)) {
config.externals.push(optionalWsNativeDeps)
} else if (config.externals) {
config.externals = [config.externals, optionalWsNativeDeps]
} else {
config.externals = [optionalWsNativeDeps]
}
config.entry.background = './main/application.ts'
config.entry.preload = './main/preload.ts'
config.module.rules.push({
test: /\.node$/,
loader: "node-loader",
})
return config;
},
// webpack: (defaultConfig, env) => Object.assign(defaultConfig, {
// entry: {
// background: './main/application.ts',
// },
// module: {
// rules: [...(defaultConfig.module.rules ? defaultConfig.module.rules : []), {
// test: /\.node$/,
// loader: "node-loader",
// }]
// }
// }),
};