Each time the code changes need to be re-packaged manually, it is troublesome, not in line with Webpack's original intention, we look at Webpack help to see if there is no way to run automatically
Input Webpack-help
You can see that there's a--watch method. It's explained that the listening system file changes we're trying.
Now the listening process has been running we changed the CSS background color for yellow Refresh page background is yellow
Every time we introduce CSS, we have to add css-loader and style-loader very troublesome webpack provide the command way
Because watch is still on. We press CTRL + C to terminate the listener input y termination
Our loader CSS is loaded with this command
How to modify the introduction of CSS in Hello.js
Write command
You'll find that the effect is the same as before. can be packaged successfully
And then we merge them with--watch.
Webpack also has a lot of commands to look at the documentation to help you understand webpack.
Webpack first section (4)