假设我们有一个非常简单的脚本:
URL url = new URL("http://www.example.in/Ramesh");
System.out.println(url.getPath().substring(1));
该脚本旨在像这样在// script.js
return {foo : "bar"};
中执行:
new Function()
但是当我将此脚本与webpack捆绑在一起时,res变成const res = new Function(`return {foo : "bar"};`) // res = {foo : "bar"}
。我猜想是因为webpack的输出包含自调用功能。
如何配置webpack使其与undefined
一起使用?