-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
24 lines (22 loc) · 675 Bytes
/
vite.config.ts
File metadata and controls
24 lines (22 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/// <reference types="vitest" />
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import packageJson from './package.json';
const packageName = packageJson.name.split('/').pop() || packageJson.name;
const toPascalCase = (string) =>
string
.match(/[a-z]+/gi)
.map((word) => word.charAt(0).toUpperCase() + word.substr(1).toLowerCase())
.join('');
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
formats: ['es', 'cjs', 'umd', 'iife'],
name: toPascalCase(packageName),
},
},
plugins: [dts({ rollupTypes: true })],
test: {},
});