My desktop application uses the Electron + React method for the interface and Edge.js to connect Node to my C # application.
My problem : Webpack cannot bind my application because the Edge.js dependency causes the following error :
Critical Addiction: A dependency request is an expression
The problem is that Edge.js requires the following dynamic:
var compilerName = 'edge-' + language.toLowerCase();
var compiler = require(compilerName);
In most cases it compilerNamewill be translated to "edge-cs", but Webpack cannot determine this.
How can I solve this problem? People suggest setting require context or ContextReplacementPlugin , but both of them are usually used when you have one require('./directory/' + variable), and I don’t know how to use them in my case when I have one require(variable).
Note. I need a solution in which I do not need to change the code of my third-party library.
source
share