Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个 Webpack 包集成到站点中。我在两个项目中都添加了块:'initial' 来优化,并且每个包都是独立的。但是,两个项目中的块似乎覆盖了全局函数,如果我同时加载两个包,这会导致诸如“n 不是函数”之类的错误。如果我切换顺序,错误可能会改变。
是否有可能在公共块中命名函数和变量?
谢谢
答案是让每个 Webpack 项目的 output.jsonpFunction 都是唯一的。
https://github.com/webpack/webpack/issues/3791