Make package
This commit is contained in:
@@ -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',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user