-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
68 lines (67 loc) · 1.66 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svg from 'vite-plugin-svgr'
import autoprefixer from 'autoprefixer'
import custommedia from 'postcss-custom-media'
import mediaminmax from 'postcss-media-minmax'
import customselector from 'postcss-custom-selectors'
import { resolve } from 'path'
export default defineConfig(({ command }) => ({
css: {
postcss: {
plugins: [
autoprefixer(), custommedia(),
mediaminmax(), customselector()
]
}
},
plugins: [
react(),
svg({
exportAsDefault: true,
svgrOptions: {
svgo: true,
svgoConfig: {
multipass: true,
full: true
}
}
}),
{
name: 'blade',
handleHotUpdate({ file, server }) {
if (file.endsWith('.blade.php')) {
server.ws.send({
type: 'full-reload',
path: '*'
})
}
}
}
],
base: command === 'serve' ? '' : '/build/',
publicDir: false,
build: {
manifest: true,
outDir: 'public/build',
rollupOptions: {
input: 'resources/inertia.tsx'
}
},
server: {
strictPort: true,
port: 3000
},
resolve: {
alias: {
$: resolve(__dirname, 'resources')
}
},
optimizeDeps: {
include: [
'react',
'@inertiajs/inertia',
'@inertiajs/inertia-react'
]
}
}))