-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrsbuild.config.ts
77 lines (75 loc) · 1.92 KB
/
rsbuild.config.ts
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
66
67
68
69
70
71
72
73
74
75
76
77
import { defineConfig } from "@rsbuild/core";
import { pluginReact } from "@rsbuild/plugin-react";
import { pluginBasicSsl } from "@rsbuild/plugin-basic-ssl";
import dotenv from "dotenv";
import path from "path";
dotenv.config();
export default defineConfig({
plugins: [pluginReact(), pluginBasicSsl()],
html: {
template: "./index.html",
title: "Champion Trader",
favicon: "public/favicon.ico",
},
source: {
define: {
"process.env.RSBUILD_WS_URL": JSON.stringify(process.env.RSBUILD_WS_URL),
"process.env.RSBUILD_WS_PUBLIC_PATH": JSON.stringify(
process.env.RSBUILD_WS_PUBLIC_PATH
),
"process.env.RSBUILD_WS_PROTECTED_PATH": JSON.stringify(
process.env.RSBUILD_WS_PROTECTED_PATH
),
"process.env.RSBUILD_REST_URL": JSON.stringify(
process.env.RSBUILD_REST_URL
),
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
"process.env.RSBUILD_SSE_PUBLIC_PATH": JSON.stringify(
process.env.RSBUILD_SSE_PUBLIC_PATH
),
"process.env.RSBUILD_SSE_PROTECTED_PATH": JSON.stringify(
process.env.RSBUILD_SSE_PROTECTED_PATH
),
},
alias: {
"@": "./src",
},
},
server: {
port: 4113,
host: "localhost",
strictPort: true,
},
output: {
copy: [
{
from: path.resolve(
__dirname,
"node_modules/@deriv-com/smartcharts-champion/dist"
),
to: "js/smartcharts/",
globOptions: {
ignore: ["**/*.LICENSE.txt"]
}
},
{
from: path.resolve(
__dirname,
"node_modules/@deriv-com/smartcharts-champion/dist/chart/assets"
),
to: "assets",
},
],
filename: {
js: "[name].[hash:8].js",
css: "[name].[hash:8].css",
assets: "assets/[name].[hash:8][ext]"
},
distPath: {
js: "js",
css: "css",
html: ""
},
cleanDistPath: true
},
});