-
Notifications
You must be signed in to change notification settings - Fork 9
/
vite.config.ts
46 lines (45 loc) · 1.2 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
import { resolve } from 'node:path'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
build: {
lib: {
entry: resolve(__dirname, 'src/cli.ts'),
name: 'VueMessDetector',
fileName: format => `vue-mess-detector.${format}.js`,
formats: ['es'], // Use only 'es'
},
rollupOptions: {
external: ['yargs', 'node:fs/promises', 'node:fs', 'fs', 'node:path', 'path', '@vue/compiler-sfc', 'vue', 'util', 'assert', 'node:url', 'url', 'os'],
output: {
globals: {
'yargs': 'yargs',
'node:fs': 'node:fs',
'node:fs/promises': 'node:fs/promises',
'fs': 'fs',
'node:path': 'node:path',
'path': 'path',
'@vue/compiler-sfc': 'compilerSfc',
'vue': 'Vue',
'util': 'util',
'assert': 'assert',
'node:url': 'node:url',
'url': 'url',
'os': 'os',
},
},
},
outDir: 'dist',
target: 'esnext',
},
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
optimizeDeps: {
exclude: ['yargs', '@vue/compiler-sfc'],
},
})