-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
37 lines (36 loc) · 1.12 KB
/
vite.config.js
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
import { resolve } from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react(), vue()],
build: {
lib: {
entry: resolve(__dirname, 'src/build.ts'),
name: 'Sharee Js',
// the proper extensions will be added
fileName: 'sharee-js',
formats: ['es']
},
rollupOptions: {
input: {
'sharee': resolve(__dirname, 'src/build.ts'),
'sharee-vue.js': resolve(__dirname, 'src/vue/Sharee.vue'),
'sharee-react.js': resolve(__dirname, 'src/react/Sharee.tsx')
},
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['vue', 'react', 'react-dom', 'ripple-effects', 'lodash.merge', 'react/jsx-runtime', '@vitejs/plugin-react'],
output: {
entryFileNames: ({ name: fileName }) => {
return `${fileName}.js`
},
// Provide global variables to use in the UMD build
// for externalized deps
// globals: {
// vue: 'Vue'
// }
}
}
}
})