[Utils > u2LoadModulePath] Fix
This commit is contained in:
parent
66f33b4665
commit
c102cf7669
1 changed files with 10 additions and 5 deletions
|
@ -1,8 +1,13 @@
|
||||||
module.exports = (moduleName) => {
|
const { readdirSync } = require('fs');
|
||||||
|
const { join } = require('path');
|
||||||
const NodeModule = require('module');
|
const NodeModule = require('module');
|
||||||
|
|
||||||
const modulesDir = _path.default.join(paths.getExeDir(), 'modules');
|
const paths = require('../paths');
|
||||||
const moduleCoreDir = _fs.default.readdirSync(modulesDir).find((x) => x.startsWith(moduleName + '-')); // Find desktop core dir by name
|
|
||||||
|
|
||||||
NodeModule.globalPaths.push(_path.default.join(modulesDir, moduleCoreDir)); // Add to globalPaths for requiring
|
|
||||||
|
module.exports = (moduleName) => {
|
||||||
|
const modulesDir = join(paths.getExeDir(), 'modules');
|
||||||
|
const moduleCoreDir = readdirSync(modulesDir).find((x) => x.startsWith(moduleName + '-')); // Find desktop core dir by name
|
||||||
|
|
||||||
|
NodeModule.globalPaths.push(join(modulesDir, moduleCoreDir)); // Add to globalPaths for requiring
|
||||||
};
|
};
|
Loading…
Add table
Add a link
Reference in a new issue