-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
webpack.config.renderer.ts
59 lines (54 loc) · 1.53 KB
/
webpack.config.renderer.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
50
51
52
53
54
55
56
57
58
59
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import webpack from 'webpack';
import merge from 'webpack-merge';
import path from 'path';
import {baseConfig, hotReloadPlugins, IS_PROD} from './webpack.config.base';
const rendererConfig: webpack.Configuration = merge(baseConfig, {
target: 'electron-renderer',
entry: {
app: './src/renderer/app.tsx',
sentry: './src/shared/sentry/renderer.ts',
},
devServer: {
contentBase: path.join(__dirname, 'dist'),
historyApiFallback: true,
port: 2003,
hot: true,
},
optimization: {
minimize: false,
// Use runtime chunk in development to fix HMR. Do not use in production
// because runtime chunks break sentry. Probably worth fixing this.
runtimeChunk: !IS_PROD ? {name: 'runtime-renderer'} : false,
},
module: {
rules: [
{
test: /\.(gif|png|jpe?g|svg)$/,
use: [
'file-loader',
{
loader: 'image-webpack-loader',
options: {
disable: true,
},
},
],
},
{
test: /\.ttf$/,
use: [{loader: 'file-loader'}],
},
],
},
plugins: [
...hotReloadPlugins,
new HtmlWebpackPlugin({title: 'Prolink Tools'}),
new webpack.DefinePlugin({'process.type': '"renderer"'}),
new ForkTsCheckerWebpackPlugin({
issue: {include: [{file: 'src/renderer/**/*'}, {file: 'src/shared/**/*'}]},
}),
],
});
export default rendererConfig;