Skip to content

Commit d04ffe9

Browse files
chore(deps): avoid using rimraf
1 parent 8c4a51a commit d04ffe9

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
"nyc": "^17.1.0",
8484
"prettier": "^3.3.3",
8585
"readable-stream": "^4.5.2",
86-
"rimraf": "^3.0.2",
8786
"sass": "^1.54.9",
8887
"sass-loader": "^16.0.2",
8988
"strip-ansi": "^6.0.1",

scripts/cleanup-test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const rimraf = require("rimraf");
1+
const fs = require("fs");
22
const { join } = require("path");
33
const collectTestFolders = require("./utils");
44

@@ -21,7 +21,9 @@ const folderStrategy = (stats, file) => {
2121

2222
const cleanupOutputDirs = () => {
2323
for (const outputFolder of collectTestFolders(folderStrategy)) {
24-
outputDirectories.forEach((dir) => rimraf.sync(join(outputFolder, dir)));
24+
outputDirectories.forEach((dir) =>
25+
fs.rmSync(join(outputFolder, dir), { recursive: true, force: true }),
26+
);
2527
}
2628
};
2729

test/build/cache/cache.test.js

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"use strict";
22

3+
const fs = require("fs");
34
const path = require("path");
4-
const rimraf = require("rimraf");
55
const { run } = require("../../utils/test-utils");
66

77
describe("cache", () => {
88
it("should work", async () => {
9-
rimraf.sync(
9+
fs.rmSync(
1010
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-default-development"),
11+
{ recursive: true, force: true },
1112
);
1213

1314
let { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.js"]);
@@ -29,11 +30,13 @@ describe("cache", () => {
2930
});
3031

3132
it("should work in multi compiler mode", async () => {
32-
rimraf.sync(
33+
fs.rmSync(
3334
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-first-development"),
35+
{ recursive: true, force: true },
3436
);
35-
rimraf.sync(
37+
fs.rmSync(
3638
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-second-development"),
39+
{ recursive: true, force: true },
3740
);
3841

3942
let { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./multi.config.js"]);
@@ -55,8 +58,9 @@ describe("cache", () => {
5558
});
5659

5760
it("should work in multi compiler mode with the `--config-name` argument", async () => {
58-
rimraf.sync(
61+
fs.rmSync(
5962
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-third-development"),
63+
{ recursive: true, force: true },
6064
);
6165

6266
let { exitCode, stderr, stdout } = await run(__dirname, [
@@ -92,8 +96,9 @@ describe("cache", () => {
9296
});
9397

9498
it("should work with the `--merge` argument", async () => {
95-
rimraf.sync(
99+
fs.rmSync(
96100
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-fourth-development"),
101+
{ recursive: true, force: true },
97102
);
98103

99104
let { exitCode, stderr, stdout } = await run(__dirname, [
@@ -131,8 +136,9 @@ describe("cache", () => {
131136
});
132137

133138
it("should work with the `--config-name` and `--merge` argument", async () => {
134-
rimraf.sync(
139+
fs.rmSync(
135140
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-fifth-development"),
141+
{ recursive: true, force: true },
136142
);
137143

138144
let { exitCode, stderr, stdout } = await run(__dirname, [
@@ -178,11 +184,12 @@ describe("cache", () => {
178184
});
179185

180186
it("should work with autoloading configuration", async () => {
181-
rimraf.sync(
187+
fs.rmSync(
182188
path.join(
183189
__dirname,
184190
"../../../node_modules/.cache/webpack/cache-test-autoloading-development",
185191
),
192+
{ recursive: true, force: true },
186193
);
187194

188195
let { exitCode, stderr, stdout } = await run(__dirname, ["--name", "cache-test-autoloading"]);

0 commit comments

Comments
 (0)