-
Notifications
You must be signed in to change notification settings - Fork 98
/
webpack.config.main.js
47 lines (45 loc) · 990 Bytes
/
webpack.config.main.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
const path = require('path');
const webpack = require('webpack');
const mode = process.env.NODE_ENV || "development";
const staticPath =
mode === "production" ?
"`${path.join(process.resourcesPath, 'static')}`" :
"'static'";
module.exports = {
mode,
target: 'electron-main',
devtool: 'source-map',
entry: './src/Main/Main.fs.js',
output: {
globalObject: 'this',
filename: 'index.js',
path: path.resolve(__dirname, 'build'),
publicPath: '',
clean: true
},
optimization: {
minimize: false,
},
module: {
rules: [
{
test: /\.js$/,
enforce: "pre",
use: ["source-map-loader"],
},
{
test: /\.(m|j|t)s$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader'
}
}
]
},
plugins: [
new webpack.DefinePlugin({ '__static': staticPath }),
],
resolve: {
extensions: ['.ts', '.js']
}
};