-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrsbuild.config.ts
More file actions
51 lines (50 loc) · 1.39 KB
/
rsbuild.config.ts
File metadata and controls
51 lines (50 loc) · 1.39 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
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { tanstackRouter } from '@tanstack/router-plugin/rspack';
import tailwindcssPostcss from '@tailwindcss/postcss';
export default defineConfig({
plugins: [pluginReact()],
html: {
meta: {
visualViewport: 'initial-scale=1, width=device-width',
},
},
source: {
define: {
// Define environment variables that will be available at build time
'process.env.BACKEND_URL': JSON.stringify(
process.env.BACKEND_URL || 'http://localhost:8080',
),
'import.meta.env.BACKEND_URL': JSON.stringify(
process.env.BACKEND_URL || 'http://localhost:8080',
),
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV || 'development',
),
'import.meta.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV || 'development',
),
'process.env.POLLING_INTERVAL': JSON.stringify(
process.env.POLLING_INTERVAL || '5000',
),
'import.meta.env.POLLING_INTERVAL': JSON.stringify(
process.env.POLLING_INTERVAL || '5000',
),
},
},
tools: {
postcss: {
postcssOptions: {
plugins: [tailwindcssPostcss],
},
},
rspack: {
plugins: [
tanstackRouter({
target: 'react',
autoCodeSplitting: true,
}),
],
},
},
});