Files
cyberduck/vite.config.ts

47 lines
1007 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
// https://vite.dev/config/
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: {
exports: 'named',
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
},
},
},
css: {
preprocessorOptions: {
scss: {
quietDeps: true,
},
},
},
}))