mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-03 22:29:38 +02:00
vite
This commit is contained in:
@@ -5,16 +5,17 @@ async function createServer() {
|
||||
const app = express();
|
||||
|
||||
// Create Vite server in middleware mode
|
||||
const vite = await createViteServer({
|
||||
configFile: './vite.config.cts',
|
||||
server: { middlewareMode: true },
|
||||
appType: 'custom', // don't include Vite's default HTML handling middlewares
|
||||
});
|
||||
// const vite = await createViteServer({
|
||||
// configFile: './vite.config.cts',
|
||||
// server: { middlewareMode: true },
|
||||
// appType: 'custom', // don't include Vite's default HTML handling middlewares
|
||||
// });
|
||||
|
||||
app.use(express.static('dist'));
|
||||
app.use(express.static('demos'));
|
||||
app.use(express.static('cypress/platform'));
|
||||
// Use vite's connect instance as middleware
|
||||
app.use(vite.middlewares);
|
||||
// app.use(vite.middlewares);
|
||||
|
||||
app.use('*', async (req, res) => {
|
||||
// Since `appType` is `'custom'`, should serve response here.
|
||||
|
Reference in New Issue
Block a user