diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7cef3e7..722b17e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,9 @@ jobs: cache-and-install: runs-on: ubuntu-latest + env: + PUBLIC_PATH: webpack5-react-template + steps: - name: Checkout uses: actions/checkout@v3 @@ -19,6 +22,9 @@ jobs: with: node-version: 18 + - name: Set Environment Variables + run: echo "PUBLIC_PATH=${{ env.PUBLIC_PATH }}" >> $GITHUB_ENV + - uses: pnpm/action-setup@v2 name: Install pnpm with: diff --git a/webpack/config.ts b/webpack/config.ts index 61014b2..aa4fdd8 100644 --- a/webpack/config.ts +++ b/webpack/config.ts @@ -15,7 +15,7 @@ loadConfig({ path: ENV_CONFIG_PATH, }) -export const PUBLIC_PATH = '/' +export const PUBLIC_PATH = process.env.PUBLIC_PATH ?? '/' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore