-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
47 lines (45 loc) · 1.09 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
38
39
40
41
42
43
44
45
46
47
/*
* @Author: fei
* @Date: 2018-01-14 00:20:43
* @Last Modified by: huaiyu
* @Last Modified time: 2022-05-19 10:49:47
*/
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebPackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
index: './src/index.js',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
},
target: 'electron-renderer',
devtool: 'inline-source-map',
mode: 'development',
devServer: {
port: 7819,
static: path.resolve(__dirname, 'dist'),
proxy: {
'*': {
target: 'http://localhost:7819?',
},
},
},
module: {
rules: [
{ test: /\.js$/, use: 'babel-loader', exclude: /node_modules/ },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.(png|svg|jpg|jpeg|gif)$/, use: ['file-loader'] },
],
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebPackPlugin({
template: './src/index.html',
filename: './index.html',
title: 'shizuka-markdown-editor',
}),
],
};