From 0ec822538c5332341b631e44260a4f391fc995cf Mon Sep 17 00:00:00 2001 From: Mark Sujew Date: Wed, 29 Jan 2025 14:29:22 +0100 Subject: [PATCH] Fix vite base path (#37) Signed-off-by: Mark Sujew --- .github/workflows/pr-previews.yml | 26 +++++--------------------- packages/playground/vite.config.ts | 8 ++++++-- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pr-previews.yml b/.github/workflows/pr-previews.yml index af37caf..f49fe8f 100644 --- a/.github/workflows/pr-previews.yml +++ b/.github/workflows/pr-previews.yml @@ -20,8 +20,7 @@ defaults: shell: bash jobs: - build-preview: - if: github.event_name == 'pull_request_target' && github.event.action != 'closed' + preview: runs-on: ubuntu-latest permissions: pull-requests: write @@ -29,39 +28,24 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Install pnpm + if: github.event.action != 'closed' uses: pnpm/action-setup@v4 with: version: 9 - name: Use Node.js + if: github.event.action != 'closed' uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' cache: 'pnpm' - name: Build Playground + if: github.event.action != 'closed' run: | pnpm install pnpm build:playground - uses: rossjrw/pr-preview-action@v1.6.0 with: - action: deploy source-dir: ./packages/playground/out preview-branch: previews umbrella-dir: pr - - # remove the preview page when the PR got closed - remove-preview: - if: github.event_name == 'pull_request_target' && github.event.action == 'closed' - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - # checkout required for pr-preview-action to succeed, - # while the content will not be used - - name: Checkout - uses: actions/checkout@v4 - - uses: rossjrw/pr-preview-action@v1.6.0 - id: deployment - with: - action: remove - preview-branch: previews - umbrella-dir: pr + token: ${{ secrets.PREVIEW_PAT_TOKEN }} diff --git a/packages/playground/vite.config.ts b/packages/playground/vite.config.ts index 0cf901b..c10bfed 100644 --- a/packages/playground/vite.config.ts +++ b/packages/playground/vite.config.ts @@ -1,7 +1,9 @@ import path from "path"; import importMetaUrlPlugin from "@codingame/esbuild-import-meta-url-plugin"; +import type { UserConfig } from "vite"; -export default { +const config: UserConfig = { + base: '', build: { target: "ES2022", rollupOptions: { @@ -21,8 +23,10 @@ export default { }, optimizeDeps: { esbuildOptions: { - plugins: [importMetaUrlPlugin], + plugins: [importMetaUrlPlugin as any], }, include: ["vscode-textmate", "vscode-oniguruma"], }, }; +export default config; +