diff --git a/.github/workflows/deploy-github-pages.yml b/.github/workflows/deploy-github-pages.yml index 3c0c03a..094c63e 100644 --- a/.github/workflows/deploy-github-pages.yml +++ b/.github/workflows/deploy-github-pages.yml @@ -36,7 +36,7 @@ jobs: run: npm ci - name: Build demo - run: npm run build:pages + run: npm run build:demo - name: Setup Pages uses: actions/configure-pages@v4 diff --git a/package.json b/package.json index 5f473a8..b7278a0 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "dev:demo": "vite", "build": "vue-tsc -b && vite build", "build:demo": "vue-tsc -b && vite build", - "build:pages": "NODE_ENV=production vue-tsc -b && vite build", "build:lib": "vite build --config vite.config.lib.ts", "preview": "vite preview", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", diff --git a/vite.config.ts b/vite.config.ts index 216665f..cafa4e5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,10 +2,10 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' // https://vite.dev/config/ -export default defineConfig({ +export default defineConfig(({ command }) => ({ plugins: [vue()], // GitHub Pages 部署时的 base 路径 - base: process.env.NODE_ENV === 'production' ? '/jordium-gantt-vue3/' : '/', + base: command === 'build' ? '/jordium-gantt-vue3/' : '/', // 开发服务器配置 root: 'demo', // 构建配置 @@ -19,4 +19,4 @@ export default defineConfig({ '@': '../src', }, }, -}) +}))