The node rimraf module recursively deletes the contents of the folder

When using the webpack build file project, a dist directory is generated every time. Sometimes, all the old files in the dist directory need to be deleted,

In addition to the RM – RF / dist / command, you can also use the rimraf / dist / command

The function of rimraf is to package the RM - RF command in the form of package to delete files and folders, regardless of whether the folder is empty or not

Local installation: NPM install rimraf — save dev

Global installation: NPM install rimraf – G

Use: rimraf & lt; path & gt; [& lt; path & gt;…]

api:rimraf(f, [opts], callback)

Read More: