Skip to content

Commit 64331a0

Browse files
committed
feat: add rsbuild config
1 parent f4a1293 commit 64331a0

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

rsbuild.config.ts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { defineConfig } from '@rsbuild/core'
2+
import { pluginVue } from '@rsbuild/plugin-vue'
3+
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill'
4+
import pkg from './package.json'
5+
6+
export default defineConfig({
7+
tools: {
8+
htmlPlugin: false,
9+
},
10+
plugins: [pluginNodePolyfill(), pluginVue()],
11+
output: {
12+
filenameHash: false,
13+
distPath: {
14+
js: '',
15+
css: '',
16+
},
17+
},
18+
environments: {
19+
web: {
20+
resolve: {
21+
extensions: ['.vue', '.js', '.css'],
22+
},
23+
source: {
24+
entry: {
25+
index: './src/components/index.js',
26+
},
27+
define: {
28+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
29+
},
30+
},
31+
output: {
32+
target: 'web',
33+
filename: {
34+
js: pkg.browser,
35+
css: pkg.style,
36+
},
37+
externals: ['vue'],
38+
},
39+
},
40+
node: {
41+
plugins: [pluginVue()],
42+
resolve: {
43+
extensions: ['.vue', '.js'],
44+
},
45+
source: {
46+
entry: {
47+
index: './src/components/index.js',
48+
},
49+
},
50+
output: {
51+
target: 'node',
52+
filename: {
53+
js: pkg.module,
54+
},
55+
},
56+
},
57+
},
58+
})

0 commit comments

Comments
 (0)