forked from deriv-com/bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rsbuild.config.ts
76 lines (74 loc) · 2.21 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
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginSass } from '@rsbuild/plugin-sass';
const path = require('path');
export default defineConfig({
plugins: [
pluginSass({
sassLoaderOptions: {
sourceMap: true,
sassOptions: {
includePaths: [path.resolve(__dirname, 'src')],
},
// additionalData: `@use "${path.resolve(__dirname, 'src/components/shared/styles')}" as *;`,
},
exclude: /node_modules/,
}),
pluginReact(),
],
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'),
'@/external': path.resolve(__dirname, './src/external'),
'@/components': path.resolve(__dirname, './src/components'),
'@/hooks': path.resolve(__dirname, './src/hooks'),
'@/utils': path.resolve(__dirname, './src/utils'),
'@/constants': path.resolve(__dirname, './src/constants'),
},
},
output: {
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: path.join(__dirname, 'public') },
],
},
html: {
template: './index.html',
},
server: {
port: 8443,
compress: true,
},
dev: {
hmr: true,
},
tools: {
rspack: {
plugins: [],
resolve: {},
module: {
rules: [
{
test: /\.xml$/,
exclude: /node_modules/,
use: 'raw-loader',
},
],
},
},
},
});