Skip to content

Commit

Permalink
Fix vite base path (#37)
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sujew <mark.sujew@typefox.io>
  • Loading branch information
msujew authored Jan 29, 2025
1 parent aec98ee commit 0ec8225
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/pr-previews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,32 @@ 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
steps:
- 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 }}
8 changes: 6 additions & 2 deletions packages/playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -21,8 +23,10 @@ export default {
},
optimizeDeps: {
esbuildOptions: {
plugins: [importMetaUrlPlugin],
plugins: [importMetaUrlPlugin as any],
},
include: ["vscode-textmate", "vscode-oniguruma"],
},
};
export default config;

0 comments on commit 0ec8225

Please sign in to comment.