mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: seperate module build
This commit is contained in:
1 parent
90a9fa95f4
commit
c2c85581c4
8 files changed
+57
-36
No files matched your search
@@ -2,6 +2,18 @@
|
||||
require('@hydrooj/utils/lib/register');
|
||||
|
||||
const { default: hook } = require('require-resolve-hook');
|
||||
const { bypass } = hook(/^(hydrooj|@hydrooj\/utils|cordis|schemastery|lodash|js-yaml)/, (id) => bypass(() => require.resolve(id)));
|
||||
const { bypass } = hook(/^(hydrooj|@hydrooj\/utils|cordis|schemastery|lodash|js-yaml)/, (id) => {
|
||||
if (id.startsWith('hydrooj/src')) {
|
||||
console.log('module require via %s is deprecated.', id);
|
||||
if (process.env.DEV) {
|
||||
console.log(
|
||||
new Error().stack.split('\n')
|
||||
.filter((i) => !i.includes('node:internal') && i.startsWith(' '))
|
||||
.join('\n'),
|
||||
);
|
||||
}
|
||||
}
|
||||
return bypass(() => require.resolve(id));
|
||||
});
|
||||
|
||||
require('./commands');
|
||||
Reference in new issue
Block a user