-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathrsbuild.config.ts
59 lines (57 loc) · 1.65 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
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_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
),
},
alias: {
"@": "./src",
},
},
server: {
port: 4113,
host: "localhost",
strictPort: true,
},
output: {
copy: [
{
from: path.resolve(__dirname, "node_modules/@deriv/deriv-charts/dist"),
to: "js/smartcharts/",
globOptions: {
ignore: ["**/*.LICENSE.txt"],
},
},
{
from: path.resolve(__dirname, "node_modules/@deriv/deriv-charts/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,
},
});