-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvite.config.ts
90 lines (88 loc) · 2.84 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';
import { fileURLToPath } from 'node:url';
import vueJsx from '@vitejs/plugin-vue-jsx';
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import svgLoader from 'vite-svg-loader';
import { watch } from 'vite-plugin-watch';
export default defineConfig({
plugins: [
laravel({
input: 'resources/ts/main.ts',
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
vueJsx(),
Components({
dirs: ['./resources/ts/components', './resources/ts/core/components'],
dts: true,
resolvers: [
(componentName) => {
if (componentName === 'VueApexCharts') return { name: 'default', from: 'vue3-apexcharts', as: 'VueApexCharts' };
},
],
}),
AutoImport({
imports: [
'vue',
'@vueuse/core',
'@vueuse/math',
'vue-i18n',
'pinia',
{ '@inertiajs/vue3': ['router', 'useForm', 'usePage'] },
// { 'vue-sonner': [['toast', 'sonnerToast']] },
],
dirs: ['./resources/ts/lib', './resources/ts/core/lib', './resources/ts/core/composables'],
vueTemplate: true,
// ℹ️ Disabled to avoid confusion & accidental usage
ignore: ['useCookies', 'useStorage'],
}),
svgLoader({
defaultImport: 'url',
}),
// watch({
// command: 'echo "generate env types" && npx dotenv-types-generator',
// pattern: ['./.env'],
// }),
],
define: { 'process.env': {
hugo: 'hugo',
} },
resolve: {
alias: {
'@': fileURLToPath(new URL('./resources/ts', import.meta.url)),
'@core': fileURLToPath(new URL('./resources/ts/core', import.meta.url)),
'@images': fileURLToPath(new URL('./resources/assets/images', import.meta.url)),
'@assets': fileURLToPath(new URL('./resources/assets', import.meta.url)),
},
},
build: {
chunkSizeWarningLimit: 500,
target: 'esnext',
},
esbuild: {
target: 'esnext',
},
optimizeDeps: {
entries: ['./resources/ts/**/*.vue'],
esbuildOptions: {
target: 'esnext',
},
},
server: {
// https: true,
hmr: { overlay: false },
watch: {
ignored: [`${__dirname}/vendor`, `${__dirname}/storage`, `${__dirname}/public`, `${__dirname}/**/*.php`],
},
},
});