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
Right now, we use UglifyJS to compress our .js files.
UglifyJS also replaces the names of most function with a new shorter name to decrease file size.
But this is a problem because it changes that function's .name property upon which JSONP Highlight's getAdapter relies.
As a consequence, Prism.plugins.jsonphighlight.removeAdapter("github") will remove the github adapter when using the development version, but it doesn't do anything when using the minified version.
Possible solutions
We could set keep_fnames: true in the mangle options of UglifyJS but this will also blow up the file size of (almost) every other file with named functions.
Change the definition of registerAdapter to take an optional name, like so:
Right now, we use UglifyJS to compress our
.js
files.UglifyJS also replaces the names of most function with a new shorter name to decrease file size.
But this is a problem because it changes that function's
.name
property upon which JSONP Highlight'sgetAdapter
relies.As a consequence,
Prism.plugins.jsonphighlight.removeAdapter("github")
will remove thegithub
adapter when using the development version, but it doesn't do anything when using the minified version.Possible solutions
keep_fnames: true
in the mangle options of UglifyJS but this will also blow up the file size of (almost) every other file with named functions.registerAdapter
to take an optional name, like so:registerAdapter
to require a name similar toPrism.hooks.add
.This is a breaking change.
The text was updated successfully, but these errors were encountered: