Open KevinKWZheng opened 6 months ago
Before what? After what?
I meant that before I introduce this module into my project, the bundled code could directly by ran by passing in 'node' command. Now it would give the error above
I'm guessing that you want to use it inside a browser with a terminal emulator.
You have to use ./lib/browser.js
as the entry point for your bundler.
You may have to add manually some files to your bundler.
Also due to the nature of Terminal-Kit, it was not meant to be browser-friendly, so good luck.
Actually, no. I am creating a Node command line app. I am trying to use Node 21's single executable file function, so I would need to bundle all my code including external modules into a single file so that I can then compile it.
Ok, so you need to include all source file manually. I use extensively lazy-loading, since there is a lot of files, and I like my CLI to start as fast as possible, so all the specific terminal config are not loaded unless used, as well as various rarely used features.
You can use ./lib/termkit-no-lazy-require.js
as the entry point, however terminal configs are still loaded dynamicly.
So you should add manually everything contained inside the ./lib/termconfig/
folder.
I can properly bundle my code before using this module with Rollup, but now after it is bundled, it gives an error:
I tried setting dynamicRequireTargets to
./termconfig/xterm.generic.js
, but this does not solve the problem