/
vite.config.ts
33 lines (30 loc) 路 914 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
import { defineConfig } from 'vite'
import path from 'node:path'
export default defineConfig({
build: {
lib: {
entry: [
path.resolve(__dirname, 'configs/recommended-alphabetical.ts'),
path.resolve(__dirname, 'configs/recommended-line-length.ts'),
path.resolve(__dirname, 'configs/recommended-natural.ts'),
path.resolve(__dirname, 'index.ts'),
],
fileName: (format, entryName) => {
let directory = ''
if (entryName.startsWith('recommended')) {
directory = 'configs/'
}
return `${directory}${entryName}.${format === 'es' ? 'mjs' : 'js'}`
},
name: 'eslint-plugin-perfectionist',
formats: ['cjs', 'es'],
},
rollupOptions: {
external: (id: string) => !id.startsWith('.') && !path.isAbsolute(id),
output: {
preserveModules: true,
},
},
minify: false,
},
})