You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is under the MIT license although it depends on [`@undecaf/zbar-wasm`](https://www.npmjs.com/package/@undecaf/zbar-wasm)
168
168
which is under LGPL.
169
+
Nevertheless, `@undecaf/zbar-wasm` may be bundled in your project as this does not violate the [LGPL requirements](https://fossa.com/blog/open-source-software-licenses-101-lgpl-license/).
170
+
171
+
Module `@undecaf/zbar-wasm`, however, expects the WASM file `zbar.wasm` to be located at the same path as itself;
172
+
details can be found in the [documentation of `@undecaf/zbar-wasm`](https://github.com/undecaf/zbar-wasm#bundlingdeploying-zbar-wasm).
173
+
Therefore, bundlers must be configured accordingly. Configuration examples for [Rollup](https://rollupjs.org/) and [esbuild](https://esbuild.github.io/)
174
+
can be found in directory [`example-bundled`](https://github.com/undecaf/barcode-detector-polyfill/tree/master/example-bundled).
175
+
They were used to bundle the JavaScript code for this [online example](https://undecaf.github.io/barcode-detector-polyfill/example-bundled/)
176
+
in [`docs/example-bundled`](https://github.com/undecaf/barcode-detector-polyfill/tree/master/docs/example-bundled).
177
+
178
+
### Loading dependency `@undecaf/zbar-wasm` at runtime
169
179
170
-
In order to comply with the LGPL, `@undecaf/zbar-wasm` must not be bundled but may only be loaded as a library at runtime.
171
-
It will be loaded from `https://cdn.jsdelivr.net` by default, but it can also be fetched from
180
+
~~In order to comply with the LGPL, `@undecaf/zbar-wasm` must not be bundled but may only be loaded as a library at runtime.~~
181
+
`@undecaf/zbar-wasm` can also be loaded at runtime, by default from `https://cdn.jsdelivr.net`. It can also be fetched from
172
182
a different endpoint if desired.
173
183
174
184
Bundlers must be configured so that they treat `@undecaf/zbar-wasm` as an external dependency instead of trying to resolve it.
175
-
Sample build configurations for [Rollup](https://rollupjs.org/) and [esbuild](https://esbuild.github.io/)
176
-
can be found in the[`example`](https://github.com/undecaf/barcode-detector-polyfill/tree/master/example) directory.
177
-
They were used to bundle the JavaScript code for the[online example](https://undecaf.github.io/barcode-detector-polyfill/example/)
178
-
in [`docs/example`](https://github.com/undecaf/barcode-detector-polyfill/tree/master/docs/example).
185
+
Configuration examples for [Rollup](https://rollupjs.org/) and [esbuild](https://esbuild.github.io/)
186
+
can be found in directory[`example-loaded`](https://github.com/undecaf/barcode-detector-polyfill/tree/master/example-loaded).
187
+
They were used to bundle the JavaScript code for this[online example](https://undecaf.github.io/barcode-detector-polyfill/example-loaded/)
188
+
in [`docs/example-loaded`](https://github.com/undecaf/barcode-detector-polyfill/tree/master/docs/example-loaded).
179
189
They also illustrate how to load `@undecaf/zbar-wasm` from a non-default endpoint.
0 commit comments