Skip to content

Commit bc51aee

Browse files
committed
fix: config error
1 parent 8fe3569 commit bc51aee

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

vite.config.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ export default defineConfig(({ mode }) => {
77
console.log('mode', mode)
88
const config = {
99
plugins: [react()],
10-
build: {
10+
}
11+
if (mode === 'production') {
12+
config.build = {
13+
lib: {
14+
// Could also be a dictionary or array of multiple entry points
15+
entry: resolve(__dirname, 'src/MindElixirReact.jsx'),
16+
name: 'MindElixirReact',
17+
// the proper extensions will be added
18+
fileName: 'mind-elixir-react',
19+
},
1120
rollupOptions: {
1221
// make sure to externalize deps that shouldn't be bundled
1322
// into your library
@@ -18,15 +27,6 @@ export default defineConfig(({ mode }) => {
1827
globals: {},
1928
},
2029
},
21-
},
22-
}
23-
if (mode === 'production') {
24-
config.build.lib = {
25-
// Could also be a dictionary or array of multiple entry points
26-
entry: resolve(__dirname, 'src/MindElixirReact.jsx'),
27-
name: 'MindElixirReact',
28-
// the proper extensions will be added
29-
fileName: 'mind-elixir-react',
3030
}
3131
}
3232
return config

0 commit comments

Comments
 (0)