-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.ts
37 lines (36 loc) · 909 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
34
35
36
37
import * as path from 'node:path'
import { defineConfig } from 'vite'
import Components from 'unplugin-vue-components/vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [
vue(),
Components({
dirs: ['src/components'],
extensions: ['vue'],
dts: 'components.d.ts',
}),
],
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'formula-editor',
formats: ['es', 'umd'],
fileName: format => `formula-editor.${format}.js`,
},
rollupOptions: {
external: ['vue', 'vue-i18n', 'codemirror', 'octicons-css', 'eslint-linter-browserify', 'vue-codemirror6', /@codemirror\/.+/, /@lezer\/.+/],
output: {
exports: 'named',
globals: {
vue: 'Vue',
},
},
},
emptyOutDir: false,
},
test: {
globals: true,
environment: 'happy-dom',
},
})