-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathrsbuild.webview.config.mjs
More file actions
67 lines (66 loc) · 1.75 KB
/
rsbuild.webview.config.mjs
File metadata and controls
67 lines (66 loc) · 1.75 KB
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
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginBabel } from '@rsbuild/plugin-babel';
import { pluginStyledComponents } from '@rsbuild/plugin-styled-components';
import { pluginSass } from '@rsbuild/plugin-sass';
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
export default defineConfig({
plugins: [
pluginNodePolyfill(),
pluginReact(),
pluginStyledComponents(),
pluginSass(),
pluginBabel({
include: /\.(?:jsx?|tsx?)$/
})
],
source: {
entry: {
index: './src/webview/index.tsx',
simple: './src/webview/simple/index.tsx'
}
},
resolve: {
alias: {
// Webview path aliases
components: './src/webview/components',
providers: './src/webview/providers',
hooks: './src/webview/hooks',
utils: './src/webview/utils',
themes: './src/webview/themes',
assets: './src/webview/assets',
selectors: './src/webview/selectors',
ui: './src/webview/ui',
views: './src/webview/views',
// @usebruno package shims for browser compatibility
'@usebruno/common/utils': './src/webview/shims/bruno-common-utils.ts',
'@usebruno/converters': './src/webview/shims/bruno-converters.ts',
'@usebruno/graphql-docs': './src/webview/shims/bruno-graphql-docs.tsx'
}
},
output: {
distPath: {
root: 'dist/webview'
},
assetPrefix: 'auto',
cleanDistPath: true,
filename: {
js: '[name].js',
css: '[name].css'
},
cssModules: {
localIdentName: '[local]'
}
},
html: {
template: './src/webview/index.html'
},
dev: {
port: 3000
},
performance: {
chunkSplit: {
strategy: 'split-by-experience'
}
}
});