-
Notifications
You must be signed in to change notification settings - Fork 11
/
webpack.prod.js
65 lines (64 loc) · 1.75 KB
/
webpack.prod.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
59
60
61
62
63
64
65
// See webpack confs in https://github.com/reZach/secure-electron-template
const webpack = require('webpack')
const path = require('path')
module.exports = {
mode: 'production',
devtool: 'nosources-source-map',
target: 'web',
entry: './src/renderer/index.ts',
module: {
rules: [
{
test: [/\.tsx?$/],
use: [
{
loader: 'babel-loader',
options: {
presets: ['@babel/preset-typescript'],
plugins: [
['babel-plugin-inferno', { imports: true }],
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-transform-modules-commonjs',
],
ignore: ['**/legacy/', '**/future/'],
},
},
'ts-loader',
],
exclude: /node_modules/,
},
{
test: /\.js$/,
include: [path.resolve(__dirname, 'node_modules/')],
resolve: {
extensions: ['.js', '.jsx', '.json'],
},
},
{
// For loading frag and vertex shaders via imports in src/renderer/render/webgl
test: /\.glsl$/,
type: 'asset/source',
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
fallback: {
// TODO(smolck): This'll probably break things in src/renderer, need an
// actual fix/polyfill/whatever
fs: false,
path: require.resolve('path-browserify'),
util: false,
net: false,
child_process: false,
os: false,
stream: false,
dns: false,
},
},
output: {
path: path.resolve(__dirname, 'build/renderer'),
filename: 'bundle.js', // The name of the webpack bundle that's generated
},
}