-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
51 lines (50 loc) · 1.03 KB
/
vite.config.ts
File metadata and controls
51 lines (50 loc) · 1.03 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'dist/index.js'),
name: 'Logger',
fileName: (format) => (format === 'es' ? 'index.es.js' : 'index.cjs'),
formats: ['es', 'cjs'],
},
rollupOptions: {
external: [
'chalk',
'ollama',
'openai',
'crypto-js',
'crypto',
'fs',
'path',
'os',
'node:fs',
'node:path',
'node:os',
'node:crypto',
],
output: {
globals: {
chalk: 'chalk',
ollama: 'ollama',
openai: 'openai',
'crypto-js': 'CryptoJS',
crypto: 'crypto',
fs: 'fs',
path: 'path',
os: 'os',
},
exports: 'named',
},
},
sourcemap: true,
minify: false,
},
plugins: [
dts({
insertTypesEntry: true,
rollupTypes: true,
}),
],
});