-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrsbuild.config.ts
80 lines (78 loc) · 1.73 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
78
79
80
import { defineConfig } from "@rsbuild/core";
import { pluginReact } from "@rsbuild/plugin-react";
import { pluginSass } from "@rsbuild/plugin-sass";
import { pluginBasicSsl } from "@rsbuild/plugin-basic-ssl";
const path = require("path");
export default defineConfig({
plugins: [
pluginSass({
sassLoaderOptions: {
sourceMap: true,
sassOptions: {},
},
exclude: /node_modules/,
}),
pluginReact(),
pluginBasicSsl(),
],
source: {
entry: {
index: "./src/main.tsx",
},
define: {
"process.env": JSON.stringify(process.env),
},
alias: {
react: path.resolve("./node_modules/react"),
"react-dom": path.resolve("./node_modules/react-dom"),
"@": path.resolve(__dirname, "./src"),
},
},
output: {
assetPrefix: "/",
copy: [
{
from: "node_modules/@deriv/deriv-charts/dist/*",
to: "js/smartcharts/[name][ext]",
globOptions: {
ignore: ["**/*.LICENSE.txt"],
},
},
{
from: "node_modules/@deriv/deriv-charts/dist/chart/assets/*",
to: "assets/[name][ext]",
},
{
from: "node_modules/@deriv/deriv-charts/dist/chart/assets/fonts/*",
to: "assets/fonts/[name][ext]",
},
{
from: "node_modules/@deriv/deriv-charts/dist/chart/assets/shaders/*",
to: "assets/shaders/[name][ext]",
},
],
},
html: {
template: "./index.html",
},
server: {
port: 8443,
compress: true,
},
dev: {
hmr: true,
},
tools: {
rspack: {
module: {
rules: [
{
test: /\.xml$/,
exclude: /node_modules/,
use: "raw-loader",
},
],
},
},
},
});