-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
39 lines (38 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
import { defineConfig } from 'vite'
import adonisjs from '@adonisjs/vite/client'
import inertia from '@adonisjs/inertia/client'
import react from '@vitejs/plugin-react'
import { getDirname } from '@adonisjs/core/helpers'
import { execSync } from 'node:child_process'
export default defineConfig({
plugins: [
inertia({ ssr: { enabled: true, entrypoint: 'inertia/app/ssr.tsx' } }),
react(),
adonisjs({ entrypoints: ['inertia/app/app.tsx'], reload: ['resources/views/**/*.edge'] }),
],
resolve: {
alias: {
'@/': `${getDirname(import.meta.url)}/inertia/`,
},
},
build: {
rollupOptions: {
plugins: [
{
name: 'generate-types',
buildStart() {
execSync('node ./node_modules/@izzyjs/route/build/src/generate_routes.js', {
stdio: 'inherit',
})
},
},
],
},
},
server: {
hmr: {
protocol: 'ws',
host: '0.0.0.0',
},
},
})