-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove base path for discord activity
- Loading branch information
1 parent
54a25fc
commit 9013e89
Showing
6 changed files
with
43 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const baseUrl = import.meta.env.BASE_URL.replace(/\/$/, ""); | ||
|
||
export function getRelativeUrl(path: string): string { | ||
return `${baseUrl}${path}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
/// <reference types="vite/client" /> | ||
|
||
interface ImportMetaEnv { | ||
readonly VITE_DISCORD_ACTIVITY: string; | ||
readonly BASE_URL: string; | ||
} | ||
|
||
interface ImportMeta { | ||
readonly env: ImportMetaEnv; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
import { defineConfig } from "vite"; | ||
import { defineConfig, loadEnv } from "vite"; | ||
import react from "@vitejs/plugin-react-swc"; | ||
import { resolve } from "path"; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react()], | ||
base: "/app", | ||
server: { | ||
proxy: { | ||
"/api": { | ||
target: "http://127.0.0.1:8080", | ||
export default ({ mode }) => { | ||
const env = loadEnv(mode, process.cwd(), ""); | ||
|
||
return defineConfig({ | ||
plugins: [react()], | ||
base: env.VITE_DISCORD_ACTIVITY === "true" ? undefined : "/app/", | ||
server: { | ||
proxy: { | ||
"/api": { | ||
target: "http://127.0.0.1:8080", | ||
}, | ||
}, | ||
base: "/app/", | ||
}, | ||
base: "/app/", | ||
}, | ||
build: { | ||
rollupOptions: { | ||
input: { | ||
main: resolve(__dirname, "index.html"), | ||
// nested: resolve(__dirname, "nested/index.html"), | ||
build: { | ||
rollupOptions: { | ||
input: { | ||
main: resolve(__dirname, "index.html"), | ||
// nested: resolve(__dirname, "nested/index.html"), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
}); | ||
}; |