mirror of
https://github.com/dzeiocom/components.git
synced 2025-07-29 08:19:50 +00:00
30
vite.config.js
Normal file
30
vite.config.js
Normal file
@ -0,0 +1,30 @@
|
||||
import path from 'path'
|
||||
import { defineConfig } from 'vite'
|
||||
import pkg from './package.json'
|
||||
import { objectKeys } from '@dzeio/object-util'
|
||||
|
||||
const external = objectKeys(pkg.dependencies)
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: './',
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, 'src/index.ts'),
|
||||
name: '@dzeio/components',
|
||||
fileName: (format) => `index.${format}.js`
|
||||
},
|
||||
rollupOptions: {
|
||||
// externalize deps that shouldn't be bundled
|
||||
// into your library
|
||||
external: ['react', 'react-dom', 'next', ...external],
|
||||
output: {
|
||||
// Provide global variables to use in the UMD build
|
||||
// for externalized deps
|
||||
globals: {
|
||||
react: 'React'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user