T
T
topuserman2020-12-21 21:41:30
css
topuserman, 2020-12-21 21:41:30

Webpack: do you really need to rebuild the project after every change?

I ran into a project with webpack, before that I did not work with it.
There was a need to make changes to the current styles and scripts.
Question: is it really necessary to rebuild the project through webpack after making each change to the source?

1. What if you need to make a couple of changes to quickly see the result without starting anything?

2. And is it possible to somehow rebuild the project remotely? For example, nmp is installed on one server, and the project is on another?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Yakimchuk, 2020-12-22
@yakimchuk-ry

But, but it's not all that bad. When you compile the project once (starting the dev-server, for example), further assembly of the project for each "sneeze" takes a few seconds, so it does not cause any particular difficulties.
On the subject:
1: It
depends on the project, but in 99% of cases, complex web applications are assembled with webpack, and then just running the file and seeing the result will not work.
Therefore, if necessary, you can design the application in such a way that it works WITHOUT assembly. For example, pure JS (not TypeScript), only relative paths, connection via System (for example), complete absence of transpilers (only pure JS/CSS). True, this will be a powerful shot at the foot of the project, and you will collect other rakes, so I highly do not recommend doing this.
2:
It is possible, but it depends on the task. Building a project is just a command, roughly, `webpack` in the terminal. You can run this on any PC, and since it's a command, it can be run remotely. Continuous integration systems work in this way, and they themselves assemble the project, test it, and so on.
Another question is that you want npm from the project, and one does not live without the other (webpack is also a module, without npm the project cannot be built, since it will turn out to install the dependencies), i.e. No. In normal mode.
In fact, in theory, you can try and even get around this, but I highly recommend not doing this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question