Answer the question
In order to leave comments, you need to log in
Building a static site. Why is the assembly in html not updated?
Good afternoon! I'm trying to set up compilation of ejs templates for a static site. The problem is that in dev mode, the assembly is rebuilt only when changes are made in the main template. If you change the files included in it (for example, header) in dev mode, the assembly is not rebuilt. Webpack not seeing changes?
template folder structure:
views
pages
index.ejs
partials
header.ejs
module.exports = {
module: {
rules: [
{
test: /\.ejs$/,
use: {
loader: 'ejs-templates-loader',
options: {}
}
}]
},
plugins: [
new HtmlWebpackPlugin ({
template: './src/views/pages/index.ejs',
filename: './index.html'
})
],
}
<body>
<h1>AAAAAAAAA</h1>
<%- include('../partials/header.ejs', {test: 123311222}) -%>
</body>
<h2><%= test %></h2>
<h3>111222</h3>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question