-
-
Notifications
You must be signed in to change notification settings - Fork 386
Closed
Labels
Description
By default, your server code isn't processed by Vite:
// server/index.js
// This file isn't processed by Vite. Consequently:
// - When changing this file, you needed to manually restart your server for your changes to take effect.
// - To use your environment variables defined in your .env files, you need to install dotenv.
// See: https://vite-plugin-ssr.com/env
// - To use your path aliases defined in your vite.config.js, you need to tell Node.js about them.
// See: https://vite-plugin-ssr.com/path-aliases
// Your server, for example an Express.js app
import express from 'express'
const app = express()
// ...If you want Vite to process your server code then use one of these:
If you merely want to transpile TypeScript, you can use:
Instead of having to use an extra tool, vike should have a new option server: './path/to/server/entry.ts'.
Edit:
- Vite is working on a built-in solution. Vike may not need to implement it, let's see.
- Ideally with a
bundled/standaloneoption, see Trying to do transpiled and bundled standalone server #1165 (which includes an example of how Vite can be configured to bundle everything). - Ideally with a seamless integration with other server entries such as Telefunc's entries.
samuelstroschein, nitedani, lubieowoce, vchirikov, bagr001 and 17 morethecotne, andreylysenko, BanDroid, blagodus and ArthurMbraga