-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrsbuild.config.ts
61 lines (59 loc) · 1.26 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
import path from 'path';
import { defineConfig, rspack } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import CompressionPlugin from 'compression-webpack-plugin';
import { dependencies } from './package.json';
const deps = {
...dependencies,
};
export default defineConfig({
plugins: [pluginReact()],
html: {
template: './public/index.html',
},
server: {
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
},
historyApiFallback: true,
compress: false,
port: 9010,
},
moduleFederation: {
options: {
name: 'rm',
filename: 'remoteEntry.js',
exposes: {
'./RemoteModule': './src/Desktop',
},
shared: {
...deps,
react: {
singleton: true,
requiredVersion: deps.react,
},
'react-dom': {
singleton: true,
requiredVersion: deps['react-dom'],
},
'@ant-design/cssinjs': {
singleton: true,
},
"@repro/some-app": {
singleton: true
}
},
},
},
tools: {
htmlPlugin: {
publicPath: '/',
},
// rspack: {
// plugins: [
// new CompressionPlugin(),
// ],
// },
},
});