Skip to content

CodeCoupler Webpack Import HTML Files

All HTML files will be included in the final JavaScript bundle if you require them with import htmlText from "./path/to/your/file.html"; in any of your JavaScript, Vue or TypeScript files. You can access to the content of the HTML file via the variable defined in this import statement.

import htmlText from "./path/to/your/file.html";
let resultingHtml = htmlText;