Skip to content

Commit 923f2e2

Browse files
committed
refactor: replace shelljs usage with fs methods
replace `shelljs` methods with native `fs` methods and removed dependency `shelljs`.
1 parent 6345642 commit 923f2e2

File tree

3 files changed

+34
-67
lines changed

3 files changed

+34
-67
lines changed

lib/compiler/assets-manager.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as chokidar from 'chokidar';
2-
import { statSync } from 'fs';
2+
import { copyFileSync, mkdirSync, rmSync, statSync } from 'fs';
33
import { sync } from 'glob';
44
import { dirname, join, sep } from 'path';
5-
import * as shell from 'shelljs';
65
import {
76
ActionOnFile,
87
Asset,
@@ -137,11 +136,11 @@ export class AssetsManager {
137136

138137
// Copy to output dir if file is changed or added
139138
if (action === 'change') {
140-
shell.mkdir('-p', dirname(dest));
141-
shell.cp(path, dest);
139+
mkdirSync(dirname(dest), { recursive: true });
140+
copyFileSync(path, dest);
142141
} else if (action === 'unlink') {
143142
// Remove from output dir if file is deleted
144-
shell.rm(dest);
143+
rmSync(dest, { force: true });
145144
}
146145
}
147146
}

package-lock.json

Lines changed: 30 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"node-emoji": "1.11.0",
5353
"ora": "5.4.1",
5454
"rimraf": "4.4.1",
55-
"shelljs": "0.8.5",
5655
"source-map-support": "0.5.21",
5756
"tree-kill": "1.2.2",
5857
"tsconfig-paths": "4.2.0",
@@ -70,7 +69,6 @@
7069
"@types/jest": "29.5.12",
7170
"@types/node": "20.12.7",
7271
"@types/node-emoji": "1.8.2",
73-
"@types/shelljs": "0.8.15",
7472
"@types/webpack-node-externals": "3.0.4",
7573
"@typescript-eslint/eslint-plugin": "7.6.0",
7674
"@typescript-eslint/parser": "7.6.0",

0 commit comments

Comments
 (0)