-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
75 lines (74 loc) · 1.69 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import vue from '@vitejs/plugin-vue';
import { fileURLToPath, URL } from 'url';
import path from 'path';
import { defineConfig } from 'vite';
import svgLoader from 'vite-svg-loader';
import checker from 'vite-plugin-checker';
import dts from 'vite-plugin-dts';
// import eslintPlugin from '@nabla/vite-plugin-eslint';
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 7001,
},
// plugins: [
// vue(),
// svgLoader(),
// eslintPlugin({
// eslintOptions: {
// cache: false,
// },
// }),
// ],
// resolve: {
// alias: {
// '@': fileURLToPath(new URL('./src', import.meta.url)),
// },
// dedupe: [
// 'vue',
// ],
// },
plugins: [
vue(),
svgLoader(),
checker({
overlay: false,
vueTsc: true,
typescript: true,
eslint: {
lintCommand: 'eslint . --ext .vue,.js,.cjs,.ts,.tsx --ignore-path .eslintignore --quiet .',
},
}),
dts({
staticImport: true,
outputDir: 'dist/types',
exclude: ['dist', 'build'],
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src/', import.meta.url)),
'~': fileURLToPath(new URL('./node_modules', import.meta.url)),
types: fileURLToPath(new URL('./types', import.meta.url)),
},
dedupe: ['vue'],
},
build: {
lib: {
entry: path.resolve(__dirname, 'src/vue-fields.ts'),
name: 'VueFields',
fileName: (format) => `vue-fields.${format}.js`,
},
cssCodeSplit: false,
cssTarget: 'chrome61',
rollupOptions: {
external: ['vue'],
output: {
globals: {
vue: 'Vue',
},
exports: 'named',
},
},
},
});