Skip to content

Commit

Permalink
Enable useCaseSensitiveFileNames in the entire process.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunabe committed May 18, 2023
1 parent cedbac2 commit 61a57e8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/converter.ts
Expand Up @@ -6,6 +6,12 @@ import { CodeMetadata } from "./metadata";
import { normalizeJoin } from "./tspath";
import { execPath } from "process";

// Enable this flag not only in sys instance in createConverter but
// in the entire process to change the behavior watch with ts.sys.watchFile.
// This workaround is necessary to fix #82.
// TODO(yunabe): Instead of enabling this, normalize filenames based on this flag.
ts.sys.useCaseSensitiveFileNames = true;

// TODO: Disallow accessing "module" of Node.js.

export interface SideOutput {
Expand Down Expand Up @@ -164,8 +170,6 @@ export function createConverter(options?: ConverterOptions): Converter {
let builder: ts.BuilderProgram = null;

const sys = Object.create(ts.sys) as ts.System;
// TODO(yunabe): Instead of enabling this, normalize filenames based on this flag.
sys.useCaseSensitiveFileNames = true;
sys.getCurrentDirectory = function () {
return cwd;
};
Expand Down

0 comments on commit 61a57e8

Please sign in to comment.