[BUG] markdownShortcutPlugin throws "Prism is not defined" error when minified #491
Open
2 tasks done
Labels
bug
Something isn't working
Describe the bug
When the
markdownShortcutPlugin
is enabled - if you build your project usingesbuild
(a very popular bundler, also used in Vite/etc) with--minify
enabled, at runtime the app throws the following error:bundle.js:170 Uncaught ReferenceError: Prism is not defined
Reproduction
As this is specific to a build process, I've set up a new minimal reproduction repo here as I'm not sure it's possible in codesandbox? https://github.com/dylanpyle/mdxeditor-esbuild
To Reproduce
Steps to reproduce the behavior:
npm install
./compile
open index.html
To confirm that it's specific to the
markdownShortcutPlugin
, remove this plugin fromapp.tsx
and run./compile
again; observe that the app now loads successfully.Expected behavior
The app loads the editor.
Screenshots
Desktop (please complete the following information):
Additional context
This issue is not present when the output bundle is not minified.
The text was updated successfully, but these errors were encountered: