Files
graphs/vite.config.ts
Cauê Faleiros 8c2590c56a
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m32s
refactor backend and persist stock campaign queue
2026-05-27 15:00:23 -03:00

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,
}
}
}
}))