Skip to content

Commit

Permalink
fix(dev): add polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrgm committed Nov 13, 2024
1 parent af06375 commit f6e068a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-baboons-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dreamkit/dev": patch
---

Add polyfill
12 changes: 12 additions & 0 deletions packages/dev/src/adapters/solid-start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ import { Plugin } from "vite";
const isEntryRoute = (id: string, value: unknown): value is Route =>
!id.startsWith("/") && isRoute(value);

// StackBlitz Polyfill

class $CustomEvent extends Event {
public detail: any;
constructor(message: string, data?: { detail: any }) {
super(message);
this.detail = data?.detail;
}
}

const CustomEvent = globalThis.CustomEvent ?? $CustomEvent;

export async function fetchDreamkitDevOptions(options: {
root: string;
}): Promise<DreamkitDevInOptions> {
Expand Down

0 comments on commit f6e068a

Please sign in to comment.