mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: use new require-resolve-hook
This commit is contained in:
2 files changed
+5
-5
No files matched your search
@@ -3,7 +3,7 @@ require('@hydrooj/utils/lib/register');
|
||||
|
||||
const packageBasedir = require('path').resolve(__dirname, '..');
|
||||
const { homedir } = require('os');
|
||||
const { default: hook } = require('require-resolve-hook');
|
||||
const { default: hook } = require('@undefined-moe/require-resolve-hook');
|
||||
const { bypass } = hook(/^(hydrooj|@hydrooj|cordis|lodash|js-yaml)($|\/)/, (id) => {
|
||||
if (id.startsWith('hydrooj/src')) {
|
||||
console.log('module require via %s is deprecated.', id);
|
||||
@@ -33,7 +33,7 @@ const { bypass } = hook(/^(hydrooj|@hydrooj|cordis|lodash|js-yaml)($|\/)/, (id)
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}, { ignoreModuleNotFoundError: false });
|
||||
|
||||
// Replace pnpm paths.
|
||||
// Vscode will try to open a local file for links, so this doesn't work for remote-ssh, etc.
|
||||
|
||||
Reference in new issue
Block a user