You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Ditch the `global` bundle in favor of `prism.global.ts` that is output to `prism.js` (see below)
- Remove chunks
Rel to #3984.
The global bundle generated only one file (`prism.js` from `auto-start.ts`) in the IIFE format. When `prism.js` was included on a web page, it created an instance of Prism (as it should) and exposed it. The plugins and languages _were not_ part of the global bundle. When we included one of those plugins, we imported an instance of Prism (`globalPrism`) from a module that is _part of another bundle_, which the global bundle was unaware of. During that process, a new instance of Prism was created, and the imported plugin attached itself to that instance, not the one we had expected (the first one instantiated). The global bundle and the plugins didn't share the same modules, since they were parts of different bundles. This should be fixed now.
Co-authored-by: Lea Verou <[email protected]>
0 commit comments