opencv-js
opencv-js copied to clipboard
Webpack.config.js
Which modules are to be added in webpack.config.js and how to add modules in webpack.config.js file? I am using Reactjs.

You can check the example here https://codesandbox.io/s/techstarkopencv-js-demo-page-f7gvk
Can you please share a simpler boilerplate code?
there is no need to add modules to webpack.config.js
you need to add @techstark/opencv-js to package.json (yarn add @techstark/opencv-js or npm install @techstark/opencv-js)
I already have installed the required dependency. It's still giving me the same error.
@ZabeehUllah see https://github.com/TechStark/opencv-js#webpack-configuration-for-browser-usage for how to configure webpack
@ZabeehUllah in case if you are asking for where & how to configure webpack,
- webpack.config.js will be in
node-modules\react-scripts\. - Search for
resolve:in webpack, (or Searchmodule.exports,resolvewill be in return of this function) - Paste the above codeblock next to
module:[.....]
fallback: {
fs: false,
path: false,
crypto: false
},
@Karthick47v2 Thank you so much. I was looking for this. Issue resolved.
Also see example https://github.com/TechStark/opencv-js-examples/blob/develop/opencv-js-react-example/config-overrides.js