Answer the question
In order to leave comments, you need to log in
webpack. How can I implement multiple versions of a site with the same codebase?
There is a project, it is necessary to implement several visually different versions of sites, but with a single code base.
I thought to write a loader for this, but I could not find how to get the entry name of the current assembly.
While in parallel I am looking for how this can be implemented through a plugin, at least self-written.
Here is an approximate structure of the component
component:
--component.ts (the default.html template is included in it)
--default.html
--second.html
At the output, we get 2 bundles
default.bundle.js and second.bundle.js, in which the only the necessary templates
Do not tell me how this can be implemented?
Answer the question
In order to leave comments, you need to log in
At the moment I found only 1 solution, make an array of webpack configurations, which is generated via map
module.exports = ["default", "second"].map(entryName => {
return {
...
{loader: "template-loader", options: {entry: entryName}}
...
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question