Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/website/src/components/Editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ const getProjectFromPool = () => {
return projectPool.pop();
} else {
const plProject = document.createElement("playground-project");
if (process.env.NODE_ENV === "development") {
plProject.sandboxBaseUrl = window.location.origin + "/";
}
return plProject;
}
}
Expand Down Expand Up @@ -391,6 +388,9 @@ export default function Editor({ html, js, css, mainFile = "main.js", canShare =

useEffect(() => {
projectRef.current = getProjectFromPool();
// Always use local static resources instead of unpkg.com CDN
// This avoids issues with webpack's import.meta.url handling
projectRef.current.sandboxBaseUrl = new URL(baseUrl, window.location.origin).href;

const activeExample = getActiveExampleContent();
let _html = activeExample.html || html;
Expand Down
Loading