I am using rollup to bundle a simple javascript application using iife
format. But I wanted to embed the bundled javascript content inside an HTML file and couldn't find the right plugin to do that.
I am not looking for ways of embedding a script tag which points to the bundle javascript file ... but rather ways of embedding the bundle content inside an html file.
Not looking for: (which is possible using plugins)
<script src="bundle.js"></script>
Looking for:
<script>
// actual bundle content (JavaScript code) here
</script>
Since I wasn't able to find any solution, I forked the rollup-plugin-generate-html-template
plugin and added the feature. Setting embedContent: true
in the plugin options will suffice.