diff --git a/package.json b/package.json index d5cd85a84f6..19fe0dab938 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,6 @@ "nyc": "^17.1.0", "prettier": "^3.3.3", "readable-stream": "^4.5.2", - "rimraf": "^3.0.2", "sass": "^1.54.9", "sass-loader": "^16.0.2", "strip-ansi": "^6.0.1", diff --git a/scripts/cleanup-test.js b/scripts/cleanup-test.js index ba76422e368..4dfe87107c1 100644 --- a/scripts/cleanup-test.js +++ b/scripts/cleanup-test.js @@ -1,4 +1,4 @@ -const rimraf = require("rimraf"); +const fs = require("fs"); const { join } = require("path"); const collectTestFolders = require("./utils"); @@ -21,7 +21,9 @@ const folderStrategy = (stats, file) => { const cleanupOutputDirs = () => { for (const outputFolder of collectTestFolders(folderStrategy)) { - outputDirectories.forEach((dir) => rimraf.sync(join(outputFolder, dir))); + outputDirectories.forEach((dir) => + fs.rmSync(join(outputFolder, dir), { recursive: true, force: true }), + ); } }; diff --git a/test/build/cache/cache.test.js b/test/build/cache/cache.test.js index 9225b4059f3..d7b8eaeb9b5 100644 --- a/test/build/cache/cache.test.js +++ b/test/build/cache/cache.test.js @@ -1,13 +1,14 @@ "use strict"; +const fs = require("fs"); const path = require("path"); -const rimraf = require("rimraf"); const { run } = require("../../utils/test-utils"); describe("cache", () => { it("should work", async () => { - rimraf.sync( + fs.rmSync( path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-default-development"), + { recursive: true, force: true }, ); let { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.js"]); @@ -29,11 +30,13 @@ describe("cache", () => { }); it("should work in multi compiler mode", async () => { - rimraf.sync( + fs.rmSync( path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-first-development"), + { recursive: true, force: true }, ); - rimraf.sync( + fs.rmSync( path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-second-development"), + { recursive: true, force: true }, ); let { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./multi.config.js"]); @@ -55,8 +58,9 @@ describe("cache", () => { }); it("should work in multi compiler mode with the `--config-name` argument", async () => { - rimraf.sync( + fs.rmSync( path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-third-development"), + { recursive: true, force: true }, ); let { exitCode, stderr, stdout } = await run(__dirname, [ @@ -92,8 +96,9 @@ describe("cache", () => { }); it("should work with the `--merge` argument", async () => { - rimraf.sync( + fs.rmSync( path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-fourth-development"), + { recursive: true, force: true }, ); let { exitCode, stderr, stdout } = await run(__dirname, [ @@ -131,8 +136,9 @@ describe("cache", () => { }); it("should work with the `--config-name` and `--merge` argument", async () => { - rimraf.sync( + fs.rmSync( path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-fifth-development"), + { recursive: true, force: true }, ); let { exitCode, stderr, stdout } = await run(__dirname, [ @@ -178,11 +184,12 @@ describe("cache", () => { }); it("should work with autoloading configuration", async () => { - rimraf.sync( + fs.rmSync( path.join( __dirname, "../../../node_modules/.cache/webpack/cache-test-autoloading-development", ), + { recursive: true, force: true }, ); let { exitCode, stderr, stdout } = await run(__dirname, ["--name", "cache-test-autoloading"]);