mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复 esm 依赖查询路径
This commit is contained in:
@@ -4,6 +4,11 @@ const path = require('path');
|
||||
const client = require('./client.js');
|
||||
require(`./env.js`);
|
||||
|
||||
// 注册 ESM loader,使全局安装的包也可通过 import 导入
|
||||
try {
|
||||
Module.register(new URL('esm-loader.mjs', `file://${__dirname}/`).href);
|
||||
} catch (_) {}
|
||||
|
||||
function preferGlobalNodeModules() {
|
||||
const { QL_NODE_GLOBAL_PATH } = process.env;
|
||||
if (!QL_NODE_GLOBAL_PATH || Module._qlGlobalPathPatched) {
|
||||
|
||||
Reference in New Issue
Block a user