vite-plugin-rsw: Cannot get it to work with build
It runs perfectly on dev but after I build my project I always get the error in the browser:
TypeError: Failed to construct 'URL': Invalid URL
Tracking it back to the generated .js file where the init() method relies on import.meta.url to construct the url of the wasm file. But that doesn’t seem to be available after building.
Interestingly I get the exact same issue when I build your Vue 3 example.
Is there something I’m missing?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (12 by maintainers)
Commits related to this issue
- fix: Invalid URL (#3) — committed to rwasm/vite-plugin-rsw by lencx 3 years ago
- feat: custom path (#3) — committed to rwasm/vite-plugin-rsw by lencx 3 years ago
@audacioustux This has not yet been achieved, can be included in the plan, please stay tuned to the project.
@kabouzeid https://github.com/lencx/vite-plugin-rsw/issues/5
@audacioustux Please install version
v1.3.1,rust cratessupports custom paths, you can userelativeorabsolutepaths.https://github.com/lencx/vite-plugin-rsw/issues/3#issuecomment-818820824
The path that meets the agreement will be automatically matched inside the plug-in, that is, the package name in the
crateis equivalent to the folder name under the root path.