Skip to content

Commit

Permalink
Merge pull request #2 from kongying-tavern/feat/init
Browse files Browse the repository at this point in the history
fix: update build path for GitHub Pages
  • Loading branch information
boxsnake authored Apr 4, 2023
2 parents ec60451 + 117e4cc commit 088fe12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions env/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_DIST_PATH='/'
1 change: 1 addition & 0 deletions env/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_DIST_PATH='/elysia-typewriter/'
10 changes: 8 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { resolve } from "node:path";

import { defineConfig } from "vite";
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import AutoImport from "unplugin-auto-import/vite";

// https://vitejs.dev/config/
const env = loadEnv(
process.env.NODE_ENV as string,
resolve(process.cwd(), "env"),
"VITE_"
);

export default defineConfig({
base: './',
base: env.VITE_DIST_PATH || "./",
server: {
host: "0.0.0.0",
port: 9000,
Expand Down

0 comments on commit 088fe12

Please sign in to comment.