-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.electron.js
More file actions
61 lines (60 loc) · 1.39 KB
/
webpack.config.electron.js
File metadata and controls
61 lines (60 loc) · 1.39 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const merge = require("webpack-merge");
const common = require("./webpack.config.common");
const path = require("path");
var CopyWebpackPlugin = require("copy-webpack-plugin");
const webpack = require('webpack');
console.log("Electron.................................");
let ELECTRON = true;
module.exports = merge(common, {
entry: {
renderer:"./electron/renderer/",
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "dist"),
},
mode: "development",
target: "electron-renderer",
/** 将编译后的代码映射回原始源代码 */
devtool: 'inline-source-map',
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 3000,
hot: true
// clientLogLevel: "none"
},
module: {
rules: [
/** css */
{
test: /\.css$/,
use: [
"style-loader",
"css-loader"
]
},
{
test: /\.(jpe?g|png|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
use: 'base64-inline-loader?limit=1000&name=[name].[ext]'
},
/** React Typescript 热加载 */
{
test: /\.tsx?$/,
use: [
"ts-loader"
]
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
ELECTRON: JSON.stringify(ELECTRON)
})
],
optimization: {
/** 拆分运行时bundle */
runtimeChunk: "single"
}
});