Open History to see the last commit
1import { resolve } from 'node:path'
2import { defineConfig } from 'vite'
3import vue from '@vitejs/plugin-vue'
4β
5export default defineConfig({
6 plugins: [vue()],
7 build: {
8 lib: {
9 // Could also be a dictionary or array of multiple entry points
10 entry: [
11 resolve(__dirname, 'src/index.ts'),
12 resolve(__dirname, 'src/production.ts'),
13 ],
14 formats: ['es'],
15 },
16 rollupOptions: {
17 // make sure to externalize deps that shouldn't be bundled
18 // into your library
19 external: ['vue'],
20 output: {
21 // Provide global variables to use in the UMD build
22 // for externalized deps
23 globals: {
24 vue: 'Vue',
25 },
26 },
27 },
28 },
29})