This repo is an attempted replication of the error noted here when using Lexical code components in a bundled environment. This repo has a very basic script that creates a Lexical editor (not attached to any element) and immediately creates a CodeHighlightNode in the context of the editor via editor.update()
Before anything, be sure to do npm i
and make sure to have Rollup, WebPack, and esbuild globally installed
Execute with rollup --config rollup.config.mjs
. Will output to dist/bundle.js
Execute with webpack
. Will output to dist/bundle.js
Execute with esbuild src/index.js --bundle --outfile=dist/bundle.js
.
The output file (dist/bundle.js
) is able to import CodeHighlight node without issue: no errors relating to Prism.