You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
800 B
TypeScript
33 lines
800 B
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
build: {
|
|
lib: {
|
|
entry: fileURLToPath(new URL('./src/index.ts', import.meta.url)),
|
|
name: 'ReactCalendario',
|
|
formats: ['es', 'umd'],
|
|
fileName: (format) => `index.${format}.js`
|
|
},
|
|
rollupOptions: {
|
|
external: ['react', 'react-dom', 'react/jsx-runtime'],
|
|
output: {
|
|
globals: {
|
|
react: 'React',
|
|
'react-dom': 'ReactDOM',
|
|
'react/jsx-runtime': 'react/jsx-runtime'
|
|
}
|
|
}
|
|
},
|
|
outDir: 'dist',
|
|
sourcemap: true,
|
|
emptyOutDir: false
|
|
},
|
|
css: {
|
|
modules: {
|
|
generateScopedName: 'rc_[local]_[hash:base64:5]'
|
|
}
|
|
}
|
|
}); |