opencv-js icon indicating copy to clipboard operation
opencv-js copied to clipboard

ES Module (ESM) import compatibility

Open AronRubin opened this issue 2 years ago • 1 comments

I need this patch script in my package.json to have opencv-js work with import in the browser (testing on Edge).

  "scripts": {
    ...
    "fix-opencv-import": "replace \"if[(]typeof window==='object'[)][{]root.cv=factory[(][)];[}]\" \"if(typeof window==='object'){window.cv=factory();}\" node_modules/@techstark/opencv-js/dist/opencv.js",
    ...
  },

Thank you

AronRubin avatar Oct 27 '23 15:10 AronRubin