Skip to content

Commit

Permalink
Allow alternate base path
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshiwarab committed Feb 7, 2025
1 parent 1b71a2c commit cc347ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 12 additions & 8 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { defineConfig } from "vite";
import { defineConfig, loadEnv } from "vite";
import path from "path";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: "./",
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");

return {
plugins: [react()],
base: env.VITE_BASE_PATH || "./",
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
},
};
});

0 comments on commit cc347ec

Please sign in to comment.