Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,5 @@
"build:compiler": "jake local",
"build:tests": "jake tests",
"clean": "jake clean"
},
"browser": {
"buffer": false,
"fs": false,
"os": false,
"path": false
}
}
}
10 changes: 8 additions & 2 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/// <reference path="core.ts"/>

namespace ts {
declare var __webpack_require__: any;

export interface System {
args: string[];
newLine: string;
Expand Down Expand Up @@ -331,12 +333,16 @@ namespace ts {
}
};
}

if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") {
return getWScriptSystem();
}
else if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined") {
else if (typeof process !== "undefined" &&
process.nextTick &&
typeof require !== "undefined" &&
typeof __webpack_require__ === "undefined") {
// process and process.nextTick checks if current environment is node-like
// process.browser check excludes webpack and browserify
// __webpack_require__ checks that current environment is not webpack (since it does not shim 'fs')
return getNodeSystem();
}
else {
Expand Down