-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathvite.config.ts
More file actions
61 lines (60 loc) · 1.89 KB
/
Copy pathvite.config.ts
File metadata and controls
61 lines (60 loc) · 1.89 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
52
53
54
55
56
57
58
59
60
61
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import dts from 'vite-plugin-dts';
export default defineConfig({
plugins: [
vue(),
dts({
include: ['index.ts', 'core.ts', 'src', 'lib'],
outDir: 'dist',
insertTypesEntry: true,
// Roll up all d.ts into a single entry (reduces published size)
rollupTypes: true,
}),
],
define: {
'process.env.NODE_ENV': '"production"',
},
build: {
lib: {
entry: {
index: 'index.ts',
core: 'core.ts',
},
name: 'StreamdownVue',
formats: ['es', 'cjs'],
fileName: (format: string, entryName: string) =>
format === 'es'
? `${entryName}.es.js`
: `${entryName}.cjs.js`,
},
rollupOptions: {
external: [
'vue',
'mermaid',
'katex',
'shiki',
/^shiki\//,
/^@shikijs\/themes\//,
/^@shikijs\/langs\//,
'marked',
'remark-parse',
'remark-gfm',
'remark-math',
'remark-rehype',
'rehype-katex',
'unified',
],
output: {
globals: { vue: 'Vue' },
// Keep only license comments we must retain (lucide, etc.)
banner: '/**\n * streamdown-vue (c) 2025 @Saluana\n * MIT Licensed. Contains portions with their own licenses (see LICENSE).\n */',
},
},
// Disable source maps for published build to reduce package size.
sourcemap: false,
// Use esbuild minification (fast) with higher target for smaller output
minify: 'esbuild',
target: 'es2022',
},
});