forked from renato-rg/electron-react-webpack
-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.ts
43 lines (39 loc) · 919 Bytes
/
webpack.config.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
import * as webpack from 'webpack';
import * as MiniCssExtractPlugin from 'mini-css-extract-plugin';
const mode = process.env.NODE_ENV === 'development' ? 'development' : 'production';
export default {
mode,
target: 'electron-renderer',
entry: './src/rendererProcess.tsx',
output: {
path: __dirname + '/dist',
publicPath: 'dist/',
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.tsx?$/i,
loader: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, "css-loader"],
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]',
},
}
]
},
plugins: [
new MiniCssExtractPlugin(),
],
resolve: {
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx']
}
} as webpack.Configuration;