html-script-module-loader
Webpack loader to transform <script type="module"> to require statements.
Install
npm install html-script-module-loader
You'll also need another loader (like raw-loader or html-loader) to actually load the HTML files.
Usage
template.html
This is the template
nested.js
console;
example.js
// Loader order is important. html-script-module-loader operates on JavaScript,// so it must run *after* (further *left* in the loader string) raw-loader or html-loader.var template = ;// => "loaded nested.js"console;// => "<h1>This is the template</h1>"
License
MIT