Make package

This commit is contained in:
2026-03-09 16:59:43 +01:00
parent 19bb022290
commit 5733a35459
7 changed files with 578 additions and 273 deletions

View File

@@ -1,7 +1,38 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
export default defineConfig(({ command }) => ({
plugins: [react()],
})
build: {
// library mode configuration
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'CyberDuck',
formats: ['es', 'cjs'],
fileName: (format) => `cyberduck.${format}.js`,
},
rollupOptions: {
// don't bundle peer deps
external: [
'react',
'react-dom',
'react-router',
'react-router-dom',
'bootstrap',
'@mui/material',
'@mui/icons-material',
'@emotion/react',
'@emotion/styled',
'react-bootstrap',
],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
},
},
},
}))