Use Rollup to inject bundled javascript into an HTML file

Posted on March 10, 2022

I wanted to create a Figma plugin and I need a way to bundle all the things into a single file. My bundler of choice is Rollup, thus, I found this module that inject the script tag into anHTML file.

Problem is that what I need is the injection of the whole raw source instead of the url reference.

I found this fork that does the job but unfortunately it doesn't work.

Therefore, I fork it and fixed all the issues, thus here the working module if you need it.