最近,我开始学习如何构建webpack插件.我正在尝试构建一个可以更新源代码的插件.
规则很简单:
aS,我要所有的变量命名haha,以hehe在上述的大块所有模块的入口点.aS,我要所有的变量命名haha到hoho所有模块中说的块入口点.这是我的代码:
a.js
const haha = 'hello';
// will be "const hehe = 'hello';" in the bundle of "aa" entry point
// will be "const hoho = 'hello';" in the bundle of "aaaa" entry point
console.log(haha);
// will be "console.log(hehe);" in the bundle of "aa" entry point
// will be "console.log(hoho);" in the bundle of "aaaa" entry …Run Code Online (Sandbox Code Playgroud) 我有一个对象:
Object { name: " ", email: " " }
Run Code Online (Sandbox Code Playgroud)
另一个:
Object { name: Array[x], email: Array[y]}
Run Code Online (Sandbox Code Playgroud)
我希望工会像:
Object { name: {" ", Array[x]}, email: {" ", Array[y]} }
Run Code Online (Sandbox Code Playgroud)