I
I
Ivan Smirnov2019-09-09 17:17:57
Node.js
Ivan Smirnov, 2019-09-09 17:17:57

How to make webpack share a port with node.js?

When developing, it is necessary that layout is given for part of the url, and Node.js processes the other

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2019-09-09
@Evan742

Webpack itself does not listen to any ports, it simply assembles your application from many files into few files, it does not need a network for this.
The network can listen to webpack-dev-server, which is just a wrapper around express + webpack-dev-middleware.
So no one bothers you to run express yourself and put webpack-dev-middleware into it, getting the same effect + extensibility of the express application
And if you wish, get rid of express, it will be enough for you to emulate the next callback and you can pass native request and response to the middleware from http module

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question