-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.react.js
More file actions
executable file
·48 lines (47 loc) · 1.11 KB
/
webpack.react.js
File metadata and controls
executable file
·48 lines (47 loc) · 1.11 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
/* eslint-disable @typescript-eslint/no-var-requires,import/no-extraneous-dependencies */
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
// mode: 'development',
mode: 'production',
entry: './src/renderer.tsx',
devtool: 'source-map',
devServer: {
static: path.join(__dirname, 'dist/renderer.js'),
compress: true,
port: 9002, // Don't use port 9000 it's used for the electron env
host: '0.0.0.0',
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts(x?)$/,
include: /src/,
use: [{ loader: 'ts-loader' }],
},
{
test: /\.s[ac]ss$/i,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
],
},
output: {
path: `${__dirname}/dist`,
filename: 'renderer.js',
},
plugins: [
new HtmlWebpackPlugin({
template: './public/index.html',
meta: {
REACT_APP_VERSION: process.env.npm_package_version,
},
}),
],
};