forked from azat-io/eslint-plugin-perfectionist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
34 lines (30 loc) · 835 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* eslint-disable unicorn/prefer-module */
// @ts-ignore
import { defineConfig } from 'vite'
import path from 'node:path'
export default defineConfig({
build: {
lib: {
entry: [
path.resolve(__dirname, 'configs/recommended.ts'),
path.resolve(__dirname, 'configs/all.ts'),
path.resolve(__dirname, 'index.ts'),
],
// @ts-ignore
fileName: (format, entryName) => {
let directory = ''
if (
entryName.startsWith('recommended') ||
entryName.startsWith('all')
) {
directory = 'configs/'
}
return `${directory}${entryName}.${format === 'es' ? 'mjs' : 'js'}`
},
formats: ['cjs', 'es'],
},
rollupOptions: {
external: (id: string) => !id.startsWith('.') && !path.isAbsolute(id),
},
},
})