Answer the question
In order to leave comments, you need to log in
Why del-cli w webpack?
The question is, According to the tutorial, you need to do
"scripts": {
"prebuild": "del-cli dist -f",
"build": "webpack src/main.js dist/bundle.js",
"execute": "node dist/bundle.js",
"start": "npm run build -s && npm run execute -s"
},
Answer the question
In order to leave comments, you need to log in
There can be many things in the dist
directory . Including some old copied files that may interfere / be not needed in the new build (which is more likely). Therefore, cleaning up the directory before creating new files is not a bad idea.
For example, you break your big bundle into pieces.
At the time of the build, you got 30 pieces.
Then you removed some code, and now you have 29 pieces. They will replace everything inside dist, but the 30th one will remain.
And if you still had a name by type: name + hash / or something else, then you will have just a bunch of rubbish in dist.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question