-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
30 lines (29 loc) · 977 Bytes
/
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
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
export default defineConfig({
plugins: [vue(), vueDevTools()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
build: {
lib: {
entry: fileURLToPath(new URL('./src/plugin.js', import.meta.url)), // Entry point of your plugin
name: 'StarRating', // Library name for UMD builds
fileName: (format) => `vue-star-rating.${format}.js`, // Output file naming
},
rollupOptions: {
external: ['vue'], // Vue is marked as an external dependency (not bundled)
output: {
globals: {
vue: 'Vue', // Vue global variable for UMD build
},
exports: 'default', // Ensure default export for your component
},
},
sourcemap: true, // Enable sourcemaps for debugging (optional)
},
})