Y
Y
yeco2021-12-15 19:38:43
webpack
yeco, 2021-12-15 19:38:43

How to include html in index.html?

Hello, I need to include the content of one html file inside index.html
i.e.

<!--noscriptNavBar.html-->
<div>This is NavBar without js</div>

<!--index.html-->
<%- include('src/noscriptNavBar.html') %>

I'm trying to do this through the default ejs-loader for htmlWebpackPlugin (as far as I understand <%= htmlWebpackPlugin.options.title %> ejs-loader syntax)
But when I get (as when trying to include ejs so with html) [email protected]
<%- include('./noscript/noscript.ejs') %>
ReferenceError: include is not defined

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question