-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathvite.config.npm.ts
56 lines (54 loc) · 1.24 KB
/
vite.config.npm.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
47
48
49
50
51
52
53
54
55
56
import path from 'node:path'
import fs from 'node:fs'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import { presetAttributify, presetIcons, presetUno } from 'unocss'
import Components from 'unplugin-vue-components/vite'
const pathSrc = path.resolve(__dirname, 'src')
// https://vitejs.dev/config/
export default defineConfig({
base: './',
resolve: {
alias: {
'@': pathSrc
}
},
plugins: [
vue({
script: {
defineModel: true,
propsDestructure: true,
fs: {
fileExists: fs.existsSync,
readFile: (file) => fs.readFileSync(file, 'utf-8')
}
}
}),
Components({
dirs: [path.resolve(pathSrc, 'components')],
dts: path.resolve(pathSrc, 'components.d.ts')
}),
UnoCSS({
presets: [presetUno(), presetAttributify(), presetIcons()]
})
],
define: {
'process.env': { ...process.env },
'process.platform': '""'
},
optimizeDeps: {
exclude: ['@vue/repl']
},
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
fileName: 'tiny-repl',
formats: ['es']
},
rollupOptions: {
external: ['typescript', 'vue']
},
minify: false
}
})