-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use vite-plugin-node along with @vitejs/plugin-react #35
Comments
I have the problem.
|
i think it's better to keep your frontend and backend separated. At your frontend vite config just proxy the |
Is there a way to have both in one project with vite-plugin-node? Enabling vite-plugin-node config disables compiling the frontend for me. |
@andersaamodt I'm having a similar problem with svelte, so seconding this question. Aiming for something like this: // express/app.ts
import express from 'express'
const app = express()
app.get('/legacy', (req, res) => {
res.send('Hello World from express!')
})
export const expressApp = app
// vite.config.js
plugins: [
sveltekit(),
...VitePluginNode({
adapter: 'express',
appPath: './express/app.ts',
exportName: 'expressApp'
})
] The express routes work fine, but it looks like the sveltekit routes are being overwritten even if I change the order of the plugins. |
FYI: #95 (comment) |
I am using this package in a fullstack setup along with remix. |
Apologies if this is a noob level question. I'm new to both vite and vite-node. I want to build an app with both a backend and a front end. As I understand vite enables you to do the front end part easily but without the backend hmr which this plugin is built for.
However I haven't figured out how to combine both with independent
server
andclient
directories each hosting it's own set of files, with theserver/index.ts
having its own/api
end points and falling back to client for the remaining*
routes. I've gone through the examples here but couldn't find what I was looking for.Any help would be appreciated, thanks!
The text was updated successfully, but these errors were encountered: