-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
58 lines (57 loc) · 1.45 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
48
49
50
51
52
53
54
55
56
57
58
const webpack = require('webpack');
const path = require('path');
const HTMLWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: path.resolve(__dirname, 'src', 'renderer', 'index.js'),
mode: 'none',
module: {
rules: [
{
test: /\.(js|jsx)$/, // checks for .js or .jsx files
exclude: /(node_modules)/,
loader: 'babel-loader',
options: { presets: ['@babel/env'] },
},
{
test: /\.css$/, //checks for .css files
use: ['style-loader', 'css-loader'],
},
{
test: /\.(png|jpg|gif|svg)$/,
type: 'asset/resource',
},
{
test: /\.jsx?$/,
include: /node_modules/,
enforce: 'pre',
use: ['source-map-loader'],
},
],
},
resolve: {
extensions: ['.*', '.js', '.jsx'],
fallback: {
path: require.resolve('path-browserify'),
},
alias: {
Components: path.resolve(__dirname, 'src/renderer/components'),
Contexts: path.resolve(__dirname, 'src/renderer/contexts'),
Hooks: path.resolve(__dirname, 'src/renderer/hooks'),
Assets: path.resolve(__dirname, 'src/renderer/assets'),
Utils: path.resolve(__dirname, 'src/renderer/utils'),
Views: path.resolve(__dirname, 'src/renderer/views'),
},
},
output: {
path: path.resolve(__dirname, 'dist', 'renderer'),
filename: 'bundle.js',
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser.js',
}),
new HTMLWebpackPlugin({
template: path.resolve(__dirname, 'src', 'renderer', 'index.html'),
}),
],
};