hi,
when building opencv.js with MODULARIZE=1 -s EXPORT_NAME="'cv'" around the line
|
var Module = globalThis.Module || (typeof {{{ EXPORT_NAME }}} != 'undefined' ? {{{ EXPORT_NAME }}} : {}); |
the final code is this:
var cv = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function (moduleArg = {}) {
var Module = moduleArg;
var cv = Module; <-- this is missing to make the code in e.g. Module[imread] work (which uses cv.somemethod)
var readyPromiseResolve, readyPromiseReject; Module["ready"] = new....
so the Module is set but should be named EXPORT_NAME ( cv in this case) ?
i always have to add the var cv = Module line in the generated code, how can this be fixed?
hi,
when building opencv.js with
MODULARIZE=1 -s EXPORT_NAME="'cv'"around the lineemscripten/src/shell.js
Line 41 in 58cf85c
the final code is this:
so the
Moduleis set but should be namedEXPORT_NAME( cv in this case) ?i always have to add the
var cv = Moduleline in the generated code, how can this be fixed?