-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
43 lines (39 loc) · 975 Bytes
/
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
import react from '@vitejs/plugin-react'
import laravel from 'laravel-vite-plugin'
import { defineConfig } from 'vite'
import { watch } from 'vite-plugin-watch'
const ReactCompilerConfig = {
target: '18', // '17' | '18' | '19'
}
export default defineConfig(({ isSsrBuild }) => ({
plugins: [
laravel({
input: [
'resources/assets/css/app.css',
'resources/assets/css/fonts.css',
'resources/app.tsx',
],
ssr: 'resources/ssr.tsx',
refresh: true,
}),
react({
babel: {
plugins: [['babel-plugin-react-compiler', ReactCompilerConfig]],
},
}),
watch({
pattern: 'app/{Data,Enums,Pages}/**/*.php',
command: 'php artisan typescript:transform',
onInit: !isSsrBuild,
}),
watch({
pattern: 'routes/*.php',
command: 'php artisan ziggy:generate resources/routes/ziggy --types',
}),
],
resolve: {
alias: {
'~/': '/resources/',
},
},
}))