@oclif/core 2.6.3 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module-loader.js +4 -1
- package/package.json +1 -1
package/lib/module-loader.js
CHANGED
|
@@ -123,12 +123,15 @@ class ModuleLoader {
|
|
|
123
123
|
static resolvePath(config, modulePath) {
|
|
124
124
|
let isESM;
|
|
125
125
|
let filePath;
|
|
126
|
+
const isPlugin = (config) => {
|
|
127
|
+
return config.type !== undefined;
|
|
128
|
+
};
|
|
126
129
|
try {
|
|
127
130
|
filePath = require.resolve(modulePath);
|
|
128
131
|
isESM = ModuleLoader.isPathModule(filePath);
|
|
129
132
|
}
|
|
130
133
|
catch {
|
|
131
|
-
filePath = Config.tsPath(config.root, modulePath);
|
|
134
|
+
filePath = isPlugin(config) ? Config.tsPath(config.root, modulePath, config.type) : Config.tsPath(config.root, modulePath);
|
|
132
135
|
let fileExists = false;
|
|
133
136
|
let isDirectory = false;
|
|
134
137
|
if (fs.existsSync(filePath)) {
|