planning-poker-gwargh/vite.config.js
efim 62a4b265c2 fix vite plugin configuration for mutliproject sbt
without 'projectID' vite plugin uses root project to run fastLinkJS
and that results in `import scalajs:main.js` attempting to import
common/.js/main.js which does not exist
2023-04-24 09:17:32 +04:00

21 lines
497 B
JavaScript

import { defineConfig } from "vite";
import scalaJSPlugin from "@scala-js/vite-plugin-scalajs";
export default defineConfig({
plugins: [scalaJSPlugin({
projectID: 'frontend',
})],
server: {
proxy: {
// Proxy all requests starting with /api to your backend server
'/api': {
target: 'http://localhost:8080',
changeOrigin: true,
ws: true, // Enable WebSocket proxying
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
});