-
Notifications
You must be signed in to change notification settings - Fork 0
/
rsbuild.config.ts
66 lines (65 loc) · 1.42 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
import { defineConfig } from '@rsbuild/core';
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginEjs } from "rsbuild-plugin-ejs";
import { rspack } from "@rspack/core";
export default defineConfig({
plugins: [pluginEjs(), pluginNodePolyfill(), pluginReact()],
output: {
cleanDistPath: true,
distPath: {
root: 'build',
},
},
html: {
template: './src/targets/browser/index.ejs',
title: 'Cozy DataProxy'
},
performance: {
chunkSplit: {
forceSplitting: {
cozy: /node_modules[\\/]cozy*/,
},
}
},
source: {
entry: {
index: './src/targets/browser/index.tsx'
}
},
tools: {
rspack: {
module: {
rules: [
{ test: /\.webapp$/i, type: "json" }
]
},
plugins: [
new rspack.CopyRspackPlugin({
patterns: [
{
from: 'manifest.webapp',
},
{
from: 'README.md'
},
{
from: 'LICENSE'
},
{
from: 'icon.svg'
},
{
from: 'src/targets/public/index.html',
to: 'reset/index.html'
},
{
from: 'src/targets/public/reset.js',
to: 'reset/reset.js'
},
],
})
]
}
}
});