mirror of
https://github.com/tale/headplane.git
synced 2026-08-18 17:06:17 +00:00
chore: switch to react-router v7
This commit is contained in:
+15
-15
@@ -1,12 +1,12 @@
|
||||
// This is a polyglot entrypoint for Headplane when running in development
|
||||
// It does some silly magic to load the vite config, set some globals that
|
||||
// are required to function, and create the vite development server.
|
||||
import { createServer } from 'vite'
|
||||
import { env, exit } from 'node:process'
|
||||
import { log } from './utils.mjs'
|
||||
import { createServer } from 'vite';
|
||||
import { env, exit } from 'node:process';
|
||||
import { log } from './utils.mjs';
|
||||
|
||||
log('DEVX', 'INFO', 'This script is only intended for development')
|
||||
env.NODE_ENV = 'development'
|
||||
log('DEVX', 'INFO', 'This script is only intended for development');
|
||||
env.NODE_ENV = 'development';
|
||||
|
||||
// The production entrypoint uses a global called "PREFIX" to determine
|
||||
// what route the application is being served at and a global called "BUILD"
|
||||
@@ -14,20 +14,20 @@ env.NODE_ENV = 'development'
|
||||
// the development server can function correctly and override the production
|
||||
// values.
|
||||
|
||||
log('DEVX', 'INFO', 'Creating Vite Development Server')
|
||||
log('DEVX', 'INFO', 'Creating Vite Development Server');
|
||||
const server = await createServer({
|
||||
server: {
|
||||
middlewareMode: true
|
||||
}
|
||||
})
|
||||
middlewareMode: true,
|
||||
},
|
||||
});
|
||||
|
||||
// This entrypoint is defined in the documentation to load the server
|
||||
const build = await server.ssrLoadModule('virtual:remix/server-build')
|
||||
const build = await server.ssrLoadModule('virtual:react-router/server-build');
|
||||
|
||||
// We already handle this logic in the Vite configuration
|
||||
global.PREFIX = server.config.base.slice(0, -1)
|
||||
global.BUILD = build
|
||||
global.MODE = 'development'
|
||||
global.MIDDLEWARE = server.middlewares
|
||||
global.PREFIX = server.config.base.slice(0, -1);
|
||||
global.BUILD = build;
|
||||
global.MODE = 'development';
|
||||
global.MIDDLEWARE = server.middlewares;
|
||||
|
||||
await import('./prod.mjs')
|
||||
await import('./prod.mjs');
|
||||
|
||||
Reference in New Issue
Block a user