-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathvite.config.ts
53 lines (49 loc) · 1.19 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
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
import glob from 'fast-glob';
import eslintPlugin from 'vite-plugin-eslint';
// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [
vue(),
eslintPlugin({
include: ['src/**/*.js', 'src/**/*.vue', 'src/**/*.ts']
})
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
components: path.resolve(__dirname, 'src/components'),
styles: path.resolve(__dirname, 'src/styles'),
utils: path.resolve(__dirname, 'src/utils')
}
},
optimizeDeps: {
include: (
await glob(['dayjs/locale/*.js'], {
cwd: path.resolve(__dirname, 'node_modules')
})
).map(p => p.replace(/\.js$/, ''))
},
build: {
// sourcemap: true,
target: 'modules',
minify: true,
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'XGantt',
fileName: 'index'
// fileName: format => `index.${format}.js`
},
rollupOptions: {
external: ['vue'],
preserveEntrySignatures: 'strict',
output: {
globals: {
vue: 'Vue'
}
}
}
}
}));