fix: prefer source mod

This commit is contained in:
cha0s 2020-12-07 06:20:30 -06:00
parent 23bfb384fc
commit 3252f681a3
2 changed files with 8 additions and 6 deletions

View File

@ -12,11 +12,12 @@ const r = eval('require');
const config = readConfig(); const config = readConfig();
const paths = Object.entries(config).map(([plugin]) => { const paths = Object.entries(config).map(([plugin]) => {
try { try {
r.resolve(plugin); const local = join(process.cwd(), 'src', plugin);
return plugin; r.resolve(local);
return local;
} }
catch (error) { catch (error) {
return join(process.cwd(), plugin); return plugin;
} }
}); });
const latus = new Latus({ const latus = new Latus({

View File

@ -11,11 +11,12 @@ module.exports = new Promise(async (resolve, reject) => {
const config = readConfig(); const config = readConfig();
const paths = Object.entries(config).map(([plugin]) => { const paths = Object.entries(config).map(([plugin]) => {
try { try {
require.resolve(plugin); const local = join(process.cwd(), 'src', plugin);
return plugin; require.resolve(local);
return local;
} }
catch (error) { catch (error) {
return join(process.cwd(), plugin); return plugin;
} }
}); });
const latus = new Latus({ const latus = new Latus({