-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
37 lines (30 loc) · 1.07 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
"use strict";
const {newConfigBuilder} = require("webpack-config-builder");
const os = require("os");
const path = require("path");
const platform = os.platform();
const pathBuild = path.resolve(__dirname, "build");
const builder = newConfigBuilder()
.withoutLicense("GPL-3.0")
.withDefine("BUILD_TYPE", "pub", "dev")
.withDefine("PLATFORM", platform);
var renderer = builder
.withCss("index.css")
.withReact()
.withHtml("./src/application/index.html", "index.html")
.withNoParse(/src(\\|\/)application(\\|\/)esimport.js$/);
var main = builder
.withNativeModules()
.withExternals({
bindings: `require("bindings")`,
});
if (platform === "linux") {
main = main.withFiles([
{ from: "node_modules/abstract-socket/build/Release/bindings.node" },
]);
}
module.exports = [
renderer.compile("web", "/src/application/index.ts", pathBuild, "[chunkhash].js", "dev.js"),
builder.compile("electron-preload", "/src/api/index.ts", pathBuild, "api.js"),
main.compile("electron-main", "/src/main/index.ts", pathBuild, "index.js"),
];