chore: remove Node.js patch on Module.globalPaths (#31275)

* chore: remove Node.js patch on Module.globalPaths

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
This commit is contained in:
Cheng Zhao 2021-10-06 09:20:05 +09:00 committed by GitHub
parent 2a92d8f962
commit 959b657903
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 36 additions and 35 deletions

13
spec/global-paths.js Normal file
View file

@ -0,0 +1,13 @@
const Module = require('module');
module.exports = (paths) => {
const nodeModulePaths = Module._nodeModulePaths;
Module.ignoreGlobalPathsHack = false;
Module._nodeModulePaths = (from) => {
if (Module.ignoreGlobalPathsHack) {
return nodeModulePaths(from);
} else {
return nodeModulePaths(from).concat(paths);
}
};
};