mirror of
https://github.com/ershisan99/ui-kit-int.git
synced 2025-12-16 20:59:25 +00:00
Initial commit
This commit is contained in:
38
vite.config.ts
Normal file
38
vite.config.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import {join, resolve} from 'node:path';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import {defineConfig} from 'vite';
|
||||
import dts from 'vite-plugin-dts';
|
||||
|
||||
// @ts-ignore
|
||||
import {peerDependencies,devDependencies} from './package.json';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
dts({rollupTypes: true}), // Output .d.ts files
|
||||
],
|
||||
build: {
|
||||
target: 'esnext',
|
||||
minify: false,
|
||||
lib: {
|
||||
entry: resolve(__dirname, join('src', 'index.ts')),
|
||||
fileName: 'index',
|
||||
formats: ['es', 'cjs'],
|
||||
},
|
||||
rollupOptions: {
|
||||
// Exclude peer dependencies from the bundle to reduce bundle size
|
||||
rollupOptions: {
|
||||
external: [
|
||||
...Object.keys(peerDependencies),
|
||||
...Object.keys(devDependencies),
|
||||
'react/jsx-runtime',
|
||||
],
|
||||
output: {
|
||||
dir: 'dist',
|
||||
entryFileNames: '[name].js',
|
||||
format: 'es',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user