Answer the question
In order to leave comments, you need to log in
How to dynamically configure an application in webpack?
I have an abstract frontend that assembles html pages with webpack. When building, I forward parameters (for example, urls) to these html pages.
Something like:
new HtmlWebpackPlugin({
template: path.resolve(__dirname, "src", "index.html"),
title: 'Some prebuild constant here',
some_url: variables.url
})
Hello world. here be <a href="<%= htmlWebpackPlugin.options.some_url %>">link</a>
<a href="<%= htmlWebpackPlugin.options.some_url %>">link</a>
<a href="#default_value" id="justarandomhash">link</a>
document.getElementById('justarandomhash').href = variables.url;
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