Skip to content

Commit

Permalink
add stages
Browse files Browse the repository at this point in the history
  • Loading branch information
mtbyk committed Jan 18, 2025
1 parent ae96503 commit 851a317
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# フロントエンドプロジェクトをビルド
- name: Build project
working-directory: src/front/vite-project
run: npm run build --mode gh-pages
run: npm run build --mode demo

# GitHub Pagesにデプロイ
- name: Deploy to GitHub Pages
Expand Down
1 change: 1 addition & 0 deletions src/front/vite-project/.env.demo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_PLATFORM=gh-pages
1 change: 1 addition & 0 deletions src/front/vite-project/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_PLATFORM=local
1 change: 1 addition & 0 deletions src/front/vite-project/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_PLATFORM=aws
18 changes: 18 additions & 0 deletions src/front/vite-project/package-lock.json

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

1 change: 1 addition & 0 deletions src/front/vite-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"devDependencies": {
"@eslint/js": "^9.13.0",
"@types/crypto-js": "^4.2.2",
"@types/node": "^22.10.7",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
Expand Down
13 changes: 9 additions & 4 deletions src/front/vite-project/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
import tsconfigPaths from "vite-tsconfig-paths"

// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tsconfigPaths()],
})
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());

return {
plugins: [react(), tsconfigPaths()],
base: env.VITE_PLATFORM === 'gh-pages' ? '/WebNovelGrepper/' : '/', // モードで切り替え
};
});

0 comments on commit 851a317

Please sign in to comment.