-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.renderer.config.ts
More file actions
44 lines (41 loc) · 965 Bytes
/
webpack.renderer.config.ts
File metadata and controls
44 lines (41 loc) · 965 Bytes
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
import type { Configuration } from 'webpack';
import { plugins } from './webpack.plugins';
const rendererRules = [
{
test: /\.tsx?$/,
exclude: /(node_modules|\.webpack)/,
use: {
loader: 'ts-loader',
options: {
transpileOnly: true,
configFile: process.env.BUILD_TYPE === 'prod' ? 'tsconfig.prod.json' : 'tsconfig.json',
},
},
},
{
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
},
];
export const rendererConfig: Configuration = {
// Add this for production builds
mode: process.env.BUILD_TYPE === 'prod' ? 'production' : 'development',
watchOptions: {
ignored: /node_modules|\.claude/,
},
module: {
rules: rendererRules,
},
plugins,
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
fallback: {
path: false,
fs: false,
},
},
target: 'web',
output: {
globalObject: 'globalThis',
},
};