forked from ytmdesktop/ytmdesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.main.config.ts
44 lines (40 loc) · 1.08 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
import { DefinePlugin, type Configuration } from "webpack";
import path from "path";
import { rules } from "./webpack.rules";
rules.push({
test: /\.tsx?$/,
exclude: /(node_modules|\.webpack)/,
use: {
loader: "ts-loader",
options: {
transpileOnly: true,
configFile: path.join(__dirname, "src/main/tsconfig.json")
}
}
});
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/main/index.ts",
// Put your normal webpack config below here
module: {
rules
},
plugins: [
new DefinePlugin({
YTMD_DISABLE_UPDATES: false,
YTMD_UPDATE_FEED_OWNER: "'ytmdesktop'",
YTMD_UPDATE_FEED_REPOSITORY: "'ytmdesktop'"
})
],
resolve: {
alias: {
"~shared": path.resolve(__dirname, "src/shared"),
"~assets": path.resolve(__dirname, "src/assets")
},
extensions: [".js", ".ts", ".jsx", ".tsx", ".css", ".json"]
},
devtool: process.env.NODE_ENV === "development" ? "eval-source-map" : false
};