How to configure webpack to Express backend and frontend?

How to collect the monolith on the Express with the usage es6 (and / or typescript) on the backend and the front? Use one config with two entrypoint? Would it be possible to tie the hot-reload?

UPD. What objective reasons not to do it? To combine the model and not to develop a separate backend and frontend separately as two different projects, KMC, should be comfortable
March 19th 20 at 08:49
1 answer
March 19th 20 at 08:51
Solution
Use one config with two entrypoint?

It is better to use different configs with a shared part. For the server, for example, it makes no sense to pull in a bundle dependencies from node_modules. Variables can have different values, and so on.

Would it be possible to tie the hot-reload?

Possible.


How to configure webpack to Express backend and frontend?

It all depends on the tasks before you and a set of tools that you want to use. Examples can be see in numerous articles on this subject and on Github.
Maybe you have any good boilerplate or just a repository with a good example? - casimir.Conroy commented on March 19th 20 at 08:54

Find more questions by tags Webpack