-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack.main.config.ts
49 lines (47 loc) · 1.24 KB
/
webpack.main.config.ts
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
import type { Configuration } from "webpack";
import CopyPlugin from "copy-webpack-plugin";
const PermissionsOutputPlugin = require("webpack-permissions-plugin");
import WebpackShellPluginNext from "webpack-shell-plugin-next";
import os from "os";
import path from "path";
import { rules } from "./webpack.rules";
const platform = os.platform();
export const mainConfig: Configuration = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: "./src/index.ts",
// Put your normal webpack config below here
module: {
rules,
},
resolve: {
extensions: [".js", ".ts", ".jsx", ".tsx", ".css", ".json"],
},
externals: [
{
"utp-native": "commonjs utp-native",
},
],
plugins: [
new CopyPlugin({
patterns: [
{ from: `libs/mpv/${platform}`, to: "libs/mpv" },
{ from: "libs/mpv/config", to: "libs/mpv/config" },
{ from: "assets", to: "assets" },
],
}),
new WebpackShellPluginNext({
onBuildEnd: {
scripts: [
`chmod +x .webpack/main/libs/mpv/mpv${
platform === "win32" ? ".exe" : ""
}`,
],
blocking: false,
parallel: true,
},
}),
],
};