Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace shelljs usage with fs methods #2526

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/compiler/assets-manager.ts
@@ -1,8 +1,7 @@
import * as chokidar from 'chokidar';
import { statSync } from 'fs';
import { copyFileSync, mkdirSync, rmSync, statSync } from 'fs';
import { sync } from 'glob';
import { dirname, join, sep } from 'path';
import * as shell from 'shelljs';
import {
ActionOnFile,
Asset,
Expand Down Expand Up @@ -137,11 +136,11 @@ export class AssetsManager {

// Copy to output dir if file is changed or added
if (action === 'change') {
shell.mkdir('-p', dirname(dest));
shell.cp(path, dest);
mkdirSync(dirname(dest), { recursive: true });
copyFileSync(path, dest);
} else if (action === 'unlink') {
// Remove from output dir if file is deleted
shell.rm(dest);
rmSync(dest, { force: true });
}
}
}
90 changes: 30 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Expand Up @@ -52,7 +52,6 @@
"node-emoji": "1.11.0",
"ora": "5.4.1",
"rimraf": "4.4.1",
"shelljs": "0.8.5",
"source-map-support": "0.5.21",
"tree-kill": "1.2.2",
"tsconfig-paths": "4.2.0",
Expand All @@ -70,7 +69,6 @@
"@types/jest": "29.5.12",
"@types/node": "20.12.7",
"@types/node-emoji": "1.8.2",
"@types/shelljs": "0.8.15",
"@types/webpack-node-externals": "3.0.4",
"@typescript-eslint/eslint-plugin": "7.6.0",
"@typescript-eslint/parser": "7.6.0",
Expand Down