All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m32s
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(({ command }) => ({
|
|
plugins: [
|
|
command === 'serve' && {
|
|
name: 'react-refresh-preamble-fix',
|
|
transformIndexHtml() {
|
|
return [{
|
|
tag: 'script',
|
|
attrs: { type: 'module' },
|
|
children: `
|
|
import RefreshRuntime from "/@react-refresh";
|
|
RefreshRuntime.injectIntoGlobalHook(window);
|
|
window.$RefreshReg$ = () => {};
|
|
window.$RefreshSig$ = () => (type) => type;
|
|
window.__vite_plugin_react_preamble_installed__ = true;
|
|
`
|
|
}]
|
|
}
|
|
},
|
|
react(),
|
|
tailwindcss()
|
|
],
|
|
server: {
|
|
port: 3001,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3004',
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
},
|
|
preview: {
|
|
port: 3000,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3004',
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
}
|
|
}))
|