I have an expression require which should get resolved in runtime but I can’t get my head around the webpack config for this simple example:
import something fro
For anyone wondering: you can solve it with this plugin:
function() {
this.parser.plugin('call require', function(expr) {
if (expr.arguments.length !== 1) {
return;
}
const param = this.evaluateExpression(expr.arguments[0]);
if (!param.isString() && !param.isConditional()) {
return true;
}
});
}
Anything that cannot be resolved by webpack will be left as is.