-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.renderer.config.js
More file actions
54 lines (53 loc) · 1.32 KB
/
Copy pathwebpack.renderer.config.js
File metadata and controls
54 lines (53 loc) · 1.32 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
49
50
51
52
53
54
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
module.exports = {
mode: 'development',
devtool: 'source-map',
entry: './src/renderer/index.tsx',
target: 'web',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
conditionNames: ['import', 'module', 'browser', 'default'],
alias: {
'@core': path.resolve(__dirname, 'src/core'),
},
},
externals: {
'manifold-3d': 'commonjs manifold-3d',
'opencascade.js': 'commonjs opencascade.js',
},
output: {
path: path.resolve(__dirname, 'dist/renderer'),
filename: 'renderer.js',
},
plugins: [
new HtmlWebpackPlugin({
template: './src/renderer/index.html',
}),
new webpack.DefinePlugin({
// Bug-report Lambda Function URL — host must also be in the CSP
// connect-src of src/renderer/index.html
'__BUG_REPORT_URL__': JSON.stringify(
process.env.BUG_REPORT_URL || 'https://4ghrpkzeex7bnuacgrrzzco4oe0xvtdo.lambda-url.us-east-1.on.aws/',
),
}),
],
devServer: {
port: 3000,
hot: true,
},
};