From cc7a3dc75dc683ac0668b520472791d83e6b7ba5 Mon Sep 17 00:00:00 2001 From: restrainhalation <168318744+restrainhalation@users.noreply.github.com> Date: Sat, 15 Jun 2024 14:16:31 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=9A=20chore:=20remove=20step=20of=20ac?= =?UTF-8?q?tions/configure-pages@v5=20#2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/nextjs.yml | 8 -------- next.config.mjs | 15 ++++++--------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml index ed74736..d8e2c57 100644 --- a/.github/workflows/nextjs.yml +++ b/.github/workflows/nextjs.yml @@ -53,14 +53,6 @@ jobs: with: node-version: "20" cache: ${{ steps.detect-package-manager.outputs.manager }} - - name: Setup Pages - uses: actions/configure-pages@v5 - with: - # Automatically inject basePath in your Next.js configuration file and disable - # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized). - # - # You may remove this line if you want to manage the configuration yourself. - static_site_generator: next - name: Restore cache uses: actions/cache@v4 with: diff --git a/next.config.mjs b/next.config.mjs index 5cce6cc..d8cc89f 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,21 +1,18 @@ import bundleAnalyzer from '@next/bundle-analyzer'; +// 環境差を埋めるためのパスのプレフィックス +const prefix = process.env.NODE_ENV === 'production' ? '/training-github-workflow' : '' + const withBundleAnalyzer = bundleAnalyzer({ enabled: process.env.ANALYZE === 'true', }); export default withBundleAnalyzer({ + images: { unoptimized: true }, + assetPrefix: prefix, + basePath: prefix, output: 'export', - // Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html` - // trailingSlash: true, - - // Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href` - // skipTrailingSlashRedirect: true, - - // Optional: Change the output directory `out` -> `dist` - // distDir: 'dist', - reactStrictMode: false, eslint: { ignoreDuringBuilds: true,