Skip to content

Commit

Permalink
Style: simplify base path normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
1nVitr0 committed Apr 28, 2023
1 parent 9f6d70e commit 29cd63a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="text-white max-h-screen h-screen overflow-hidden bg-bg">
<div class="text-white max-h-screen h-screen overflow-hidden bg-bg">
<app-appbar />

<app-side-rail v-if="isShowingSideRail" class="hidden md:block" />
Expand Down
10 changes: 4 additions & 6 deletions server/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,11 @@ class Server {
}
}

// Apply the current RouterBasePath to all `<base>` tags in the client html files
// Apply the current RouterBasePath to all html and js files
async applyClientBasePath() {
const basePath = `/${global.RouterBasePath}/`
.replace('///', '') // convert base path `"/""` to `""`
.replace('//', '/') // Ensure there are single `/` at the front and end
.slice(0, -1) // Remove trailing `/`
const basePathSlash = `${basePath}/`
const basePathSlash = `/${global.RouterBasePath}/`
.replace(/\/\/+/, '/') // Ensure there are single `/` at the front and end
const basePath = basePathSlash.slice(0, -1) // Remove trailing `/`
const distPath = Path.join(global.appRoot, '/client/dist')

// Check if the client base path is already set to the current base path
Expand Down

0 comments on commit 29cd63a

Please sign in to comment.