Skip to content

Commit

Permalink
refactor: remove path.resolve()
Browse files Browse the repository at this point in the history
- require.resolve() by Node.js follows a Node.js module resolution algo
  which includes checking if the resolved path actually exists on the
  file system.
  • Loading branch information
khoaHyh committed Jan 24, 2024
1 parent bd47d79 commit 4aad184
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/cli/collect-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ module.exports = ({
}, []);

fileArgs.forEach(file => {
const fileAbsolutePath = path.resolve(file);
try {
require.resolve(fileAbsolutePath);
require.resolve(file);
} catch (err) {
// this error doesn't bubble up to the middleware like how
// --require handles it so we have to do it here
Expand Down

0 comments on commit 4aad184

Please sign in to comment.