Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: github issue #4439: case insensitive compare of file paths. #4440

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion cli/run/loadConfigFile.ts
Expand Up @@ -8,6 +8,7 @@ import { bold } from '../../src/utils/colors';
import { error } from '../../src/utils/error';
import { mergeOptions } from '../../src/utils/options/mergeOptions';
import type { GenericConfigObject } from '../../src/utils/options/options';
import { isSamePath } from '../../src/utils/path';
import relativeId from '../../src/utils/relativeId';
import { stderr } from '../logging';
import batchWarnings, { type BatchWarnings } from './batchWarnings';
Expand Down Expand Up @@ -108,7 +109,7 @@ async function loadConfigFromBundledFile(fileName: string, bundledCode: string):
const extension = extname(resolvedFileName);
const defaultLoader = require.extensions[extension];
require.extensions[extension] = (module: NodeModule, requiredFileName: string) => {
if (requiredFileName === resolvedFileName) {
if (isSamePath(requiredFileName, resolvedFileName)) {
(module as NodeModuleWithCompile)._compile(bundledCode, requiredFileName);
} else {
defaultLoader(module, requiredFileName);
Expand Down