-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathvite.config.mts
More file actions
50 lines (46 loc) · 1.49 KB
/
vite.config.mts
File metadata and controls
50 lines (46 loc) · 1.49 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
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import { visualizer } from "rollup-plugin-visualizer";
export default defineConfig({
// If our .vue files have a style, it will be compiled as a single `.css` file under /dist.
plugins: [
Vue({ style: { filename: 'style.css' } }),
visualizer({
filename: resolve(__dirname, 'stats.html'),
template: 'treemap', // sunburst|treemap|network
sourcemap: true
}),
],
resolve: {
alias: {
"@": resolve(__dirname, "./src/"),
},
},
build: {
// Output compiled files to /dist.
outDir: './dist',
lib: {
// Set the entry point (file that contains our components exported).
entry: resolve(__dirname, 'src/index.ts'),
// Name of the library.
name: 'formbuilder',
// We are building for CJS and ESM, use a function to rename automatically files.
// Example: my-component-library.esm.js
fileName: (format) => `${'formbuilder'}.${format}.js`,
},
rollupOptions: {
// Vue is provided by the parent project, don't compile Vue source-code inside our library.
external: ['vue'],
output: {
globals: { vue: 'Vue' }
},
},
sourcemap: true
},
test: {
deps: {
interopDefault: true,
},
}
})