diff --git a/lib/core/src/server/serverRequire.js b/lib/core/src/server/serverRequire.js index 9deb4cba90e9..aab3dc8a4d5d 100644 --- a/lib/core/src/server/serverRequire.js +++ b/lib/core/src/server/serverRequire.js @@ -78,13 +78,10 @@ export default function serverRequire(filePath) { const { path: candidatePath, ext: candidateExt } = existingCandidate; - if (candidateExt === '.js') { - return interopRequireDefault(candidatePath); - } - const moduleDescriptor = interpret.extensions[candidateExt]; - if (moduleDescriptor !== null && registerCompiler(moduleDescriptor) === 0) { + // The "moduleDescriptor" either "undefined" or "null". The warning isn't needed in these cases. + if (moduleDescriptor && registerCompiler(moduleDescriptor) === 0) { logger.warn(`=> File ${candidatePath} is detected`); logger.warn(` but impossible to import loader for ${candidateExt}`);