Skip to content
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

Fix bundler looking for index.<chunk_hash>.wasm #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

greym0uth
Copy link
Contributor

@greym0uth greym0uth commented May 21, 2022

Seems like I missed something in my initial PR as that made it work for vite but didn't work with vite build and vite preview.

It seems newer versions of wasm-pack or at least my version uses import.meta.url for getting the current file, so the existing regex replace isn't capturing it so I get a 404 fetching the wasm as its looking for index.<chunk_hash>_bg.wasm which doesnt exist.

This also uses the transform hook to replace the input in the modulePaths entry file's because I was running into an issue with pnpm caching; I just removed the isNodeModule logic from the buildStart as the transform handles that piece now. I left the cratePaths variant in the buildStart as it relies on the fs.copy so I didn't want to break anything in that aspect.

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.

None yet

1 participant