-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
57 lines (56 loc) · 1.41 KB
/
vite.config.js
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
import vue from '@vitejs/plugin-vue';
import laravel from 'laravel-vite-plugin';
import path from 'node:path';
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { defineConfig } from 'vite';
export default defineConfig(({ mode }) => {
return {
build: {
reportCompressedSize: mode === 'development' ? false : true,
rollupOptions: {
output: {
assetFileNames: mode === 'development' ? 'css/[name].[ext]' : 'css/[name].[hash].[ext]',
entryFileNames: mode === 'development' ? 'js/[name].js' : 'js/[name].[hash].js'
}
}
},
plugins: [
AutoImport({
defaultExportByFilename: true,
dts: 'resources/js/types/auto-imports.d.ts',
eslintrc: {
enabled: true
},
imports: [
'vue'
],
vueTemplate: true
}),
Components({
dirs: ['resources/js/components'],
dts: 'resources/js/components.d.ts'
}),
laravel({
input: ['resources/js/app.ts'],
refresh: true
}),
vue({
script: {
defineModel: true
},
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false
}
}
})
],
resolve: {
alias: {
'@': path.resolve(__dirname, './resources/js')
}
}
};
});