Skip to content

get non-webcontainer version working, and embeddable on cross-origin-isolated site #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2022

Conversation

Rich-Harris
Copy link
Member

This re-enables the non-WebContainer version of the app, which I need for demo purposes (it might also prove useful for people using Safari etc).

To do it in such a way that the site can be embedded on a page with cross-origin isolation, we need to inject a src/hooks.js file. For now it only adds one if it doesn't already exist; to be complete we'd need to do something like rename the existing src/hooks.js to src/_hooks.js, then do this:

export * from './_hooks.js';
import { handle as original_handle } from './_hooks.js';

export async function handle({ event, resolve }) {
  const response = await original_handle({ event, resolve });
  response.headers.set('...');
  return response;
}

I'm too lazy to do that right now though.

To enable filesystem mode, start the server with VITE_USE_FILESYSTEM=1 pnpm dev.

@vercel
Copy link

vercel bot commented Jun 14, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
learn-svelte-dev ✅ Ready (Inspect) Visit Preview Jun 14, 2022 at 2:51AM (UTC)

@Rich-Harris Rich-Harris merged commit 66557a8 into main Jun 14, 2022
@Rich-Harris Rich-Harris deleted the filesystem branch June 14, 2022 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant