-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathvite.config.ts
More file actions
65 lines (63 loc) · 2.03 KB
/
Copy pathvite.config.ts
File metadata and controls
65 lines (63 loc) · 2.03 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { defineConfig, loadEnv } from 'vite'
import laravel from 'laravel-vite-plugin'
import { google } from 'laravel-vite-plugin/fonts'
import vue from '@vitejs/plugin-vue'
import tailwindcss from "@tailwindcss/vite"
import Components from 'unplugin-vue-components/vite'
import { PrimeVueResolver } from '@primevue/auto-import-resolver'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
// https://vite.dev/config/#using-environment-variables-in-config
const env = loadEnv(mode, process.cwd(), '')
const devPort = env.VITE_APP_PORT ? Number(env.VITE_APP_PORT) : 5173
const hostDomain = env.VITE_HOST_DOMAIN || 'localhost'
return {
plugins: [
laravel({
input: 'resources/js/app.ts',
ssr: 'resources/js/ssr.ts',
refresh: true,
fonts: [
google('Inter', {
alias: 'sans',
weights: [400, 500, 600, 700],
styles: ['normal', 'italic'],
subsets: ['latin'],
display: 'swap',
preload: [
{ weight: 400 },
{ weight: 700 },
],
fallbacks: ['system-ui', 'sans-serif'],
}),
],
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
tailwindcss(),
Components({
resolvers: [PrimeVueResolver()],
}),
],
server: {
port: devPort,
host: true,
hmr: {
host: hostDomain,
},
cors: true,
watch: {
usePolling: true,
},
},
preview: {
port: devPort,
},
}
})