TypeStrong / tsify

Browserify plugin for compiling TypeScript
345 stars 74 forks source link

Detect fs case sensitivity based on it's real behavior #200

Closed koroandr closed 8 years ago

koroandr commented 8 years ago

In lib/Host.js there is such line (134):

    Host.prototype.useCaseSensitiveFileNames = function () {
        var platform = os.platform();
        return platform !== 'win32' && platform !== 'win64' && platform !== 'darwin';
    };

It detects case-sensitivity based on platform name, which is considered a bad practice.

I am working on Mac OS system with case-sensitive file system, so the following code

    Host.prototype.getCanonicalFileName = function (filename) {
        return ts.normalizeSlashes(ts.sys.useCaseSensitiveFileNames ? filename : filename.toLowerCase());
    };

breaks my paths.

I also created similar issue in TypeScript project.

cartant commented 8 years ago

That all sounds pretty reasonable. I'll look into it tomorrow. Thanks.

koroandr commented 8 years ago

I actually already did a quick fix for that - https://github.com/TypeStrong/tsify/pull/201