mirror of
https://github.com/tale/headplane.git
synced 2026-08-25 11:56:49 +00:00
fix: handle non-prefixed routes on the production server
This commit is contained in:
+5
-5
@@ -6,9 +6,9 @@ import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
|
||||
installGlobals()
|
||||
|
||||
const prefix = process.env.__INTERNAL_PREFIX || '/admin/'
|
||||
if (!prefix.endsWith('/')) {
|
||||
throw new Error('Prefix must end with a slash')
|
||||
const prefix = process.env.__INTERNAL_PREFIX || '/admin'
|
||||
if (prefix.endsWith('/')) {
|
||||
throw new Error('Prefix must not end with a slash')
|
||||
}
|
||||
|
||||
export default defineConfig(({ isSsrBuild }) => {
|
||||
@@ -43,11 +43,11 @@ export default defineConfig(({ isSsrBuild }) => {
|
||||
}
|
||||
|
||||
return ({
|
||||
base: prefix,
|
||||
base: `${prefix}/`,
|
||||
build: isSsrBuild ? { target: 'ES2022' } : {},
|
||||
plugins: [
|
||||
remix({
|
||||
basename: prefix,
|
||||
basename: `${prefix}/`,
|
||||
}),
|
||||
tsconfigPaths(),
|
||||
babel({
|
||||
|
||||
Reference in New Issue
Block a user