Open iva2k opened 3 years ago
A better approach is to use webpack require.context(). Will you accept a PR with such fix?
This module is not required for browser applications. It looks like a similar issue was addressed in https://github.com/tuzemec/jzz-webpack-test
Electron applications that have webpack configured will be blocked by this. (For example, I was starting off from the boilerplate https://github.com/electron-react-boilerplate) Can we have this fixed?
Although being a hack, I found this works well with webpack:
const require_dynamic = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
module.exports = require_dynamic(path);
module.exports.package = require_dynamic(__dirname + '/package.json');
Ref: https://stackoverflow.com/questions/42797313/webpack-dynamic-module-loader-by-require
Using jzz@1.3.9 package (which has jazz-midi package as a dependency) in a React app (create-react-app), gets this warning:
The problem is any CI flow treats warnings as errors and chokes on it.
Looking into
./node_modules/jazz-midi/index.js
:... which has a dynamic require().
Webpack docs explain it here: https://webpack.js.org/guides/dependency-management/#require-with-expression