Answer the question
In order to leave comments, you need to log in
How to connect EJS to Webpack?
I set up Webpack production mode, it works like a Swiss watch.
But I ran into one problem with development mode.
When you start development mode, it turns out that the dist folder is somewhere in the Webpack memory and in order for it to be created / updated, you need to run the build through production mode.
When I render EJS by the server, it does not see the .css, .js and other files, as they have not been created/updated yet.
At this point, I don’t understand how I can properly connect EJS to Webpack so that when I start development mode, I have access to .css, .js and other files.
My loader is like this:
{
test: /\.ejs$/,
loader: 'ejs-loader'
}
new HtmlWebpackPlugin({
hash: false,
template: `${PATHS.src}/index.ejs`,
filename: './index.ejs'
})
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