-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: add wasm file to exports #186
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks! Does vite have documentation for this? |
It's not specific to vite. // if using "type":"module"
// import { createRequire } from "module";
// const require = createRequire(import.meta.url);
try {
// This works
const indexFile = require.resolve("@resvg/resvg-wasm");
console.log({ indexFile });
// This does not work
const wasmFile = require.resolve("@resvg/resvg-wasm/index_bg.wasm");
console.log({ wasmFile });
} catch (error) {
console.error({ error });
} this code works after adding the wasm file to exports. From nodejs.org
|
Can you add a test case to |
It turns out that the From nodejs.org
|
Thank you very much, let's merge it first. |
@yisibl I got the same error with webpack! Could you please release this patch?
|
require.resolve and bundlers like vite are unable to resolve the wasm file.
Cheers