-
Notifications
You must be signed in to change notification settings - Fork 15
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
How to bundle zbar.wasm in a module project? #11
Comments
@iBobik Apologies for my late reply, I have been on vacation. I cannot provide a simple solution to this issue; I can only present my findings, hoping that they are helpful. CommonJS targetsThe CommonJS build of Rollup 3I have not been able to make Rollup bundle Webpack 5The WASM/ESM glue logic in Next steps for zbar-wasmThe |
I don't know if this is helpful for this specific issue, I apologize if it is not. As import { defineConfig } from "vite";
import wasm from "vite-plugin-wasm";
export default defineConfig({
plugins: [wasm()],
// config below makes the build work.
optimizeDeps: {
exclude: [
"@undecaf/zbar-wasm"
]
},
}); this works both in dev and prod, where the build puts out
|
Thank you @fspoettel ! @iBobik Plugin Edit:The latest version of |
@iBobik zbar-wasm v0.10.0 should resolve this issue. PTAL at Closing this, please feel free to re-open. |
Thank you. I will work on it at the end of month.
3. 9. 2023 15:46:28, undecaf ***@***.***> napsal:
… Closed #11 <#11> as completed.
—
Reply to this email directly, view it on GitHub
<#11 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEV6WAXJRCDSKVAOE65INDXYSC3JANCNFSM6AAAAAA3OBPLQU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@undecaf I am looking into it, but found I will probably need you to update also barcode-detector-polyfill. |
I develop capacitor-community/barcode-scanner and want to make it support off-line, so zbar.wasm needs to be included.
I successfully included it in a dist of this module:
But when I use barcode-scanner in my project (
npm i "@capacitor-community/barcode-scanner@../barcode-scanner"
for local development) and build it, resulting dist does not include zbar.wasm file.I checked example-bundled, but this seems not intended for use in the module project (and also it is for old rollup 2).
Or it is really necessary to ask module's users to bundle zbar.wasm themself? How to make zbar-wasm to require it correctly then?
Thank you for your help.
The text was updated successfully, but these errors were encountered: