- removeCache.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| const fs = require("fs"); const child_process = require("child_process");
const deleteFolder = async function (path) { var files = []; if (fs.existsSync(path)) { files = fs.readdirSync(path); files.forEach(function (file, index) { var curPath = path + "/" + file; if (fs.statSync(curPath).isDirectory()) { deleteFolder(curPath); } else { fs.unlinkSync(curPath); } }); await fs.rmdirSync(path); } }; deleteFolder("./node_modules/.cache/compression-webpack-plugin");
|
- package.json
1 2 3 4 5
| { "script": { "rmcatch": "node ./removeCache.js" } }
|