Closed crgeary closed 4 years ago
Hi, I won’t be accepting this.
It’s not recommended to bundle instant.page with the rest of your JS. Loading instant.page is low priority and is thus best served with a defer
attribute. It’s also ES6 syntax and must be served as a module, which the rest of most sites’ scripts usually aren’t, so that older browsers don’t throw an error.
If one bundles it though, the usual way to do this is by loading it as a module nowadays, not by just concatenating scripts.
Thanks anyway.
Hi,
Thanks for the response. My mistake, I didn't realise this was how type="module"
worked.
Thanks for the information.
@dieulot Hi Alexandre! Could you recommend the best solution to this when using instant.page plugin for wordpress? At the moment the bundled version is not scoped and creates variable conflicts.
Added an IIFE around the existing code to scope variables to this library. The minified version, for example, has a constant called
c
which conflicts with another library on our site, also with a constant calledc
as neither are scoped.