Automattic / liveblog

Liveblogging done right. Using WordPress.
https://wordpress.org/plugins/liveblog/
311 stars 122 forks source link

Avoid namespace collision with multi-webpack runtimes #660

Closed ellm closed 4 weeks ago

ellm commented 4 years ago

If multiple webpack runtimes (from different compilations) are used on the same webpage, there is a risk of conflicts of on-demand chunks in the global namespace.

See: https://webpack.js.org/configuration/output/#outputjsonpfunction

When a conflict occurs, it causes a fatal JS error. I have experienced this behavior when a site bundle and Liveblog bundle are loaded on the same page.

According to Webpack documentation, changing output.jsonpFunction to a custom name will avoid the collision.

paulschreiber commented 4 years ago

cc @pypwalters

paulschreiber commented 4 years ago

@ellm have you looked at https://github.com/paulschreiber/liveblog ?

ellm commented 4 years ago

@ellm have you looked at https://github.com/paulschreiber/liveblog ?

Thanks @paulschreiber - I have not. I'll take a look though.