mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #4308 from Microsoft/adjustNodeCheck
adjust check for node env to handle webpack\browserify
This commit is contained in:
commit
5fbe3fc75c
2 files changed
+10
-2
No files matched your search
+7
-1
@@ -43,5 +43,11 @@
|
||||
"build:compiler": "jake local",
|
||||
"build:tests": "jake tests",
|
||||
"clean": "jake clean"
|
||||
}
|
||||
},
|
||||
"browser": {
|
||||
"buffer": false,
|
||||
"fs": false,
|
||||
"os": false,
|
||||
"path": false
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -334,7 +334,9 @@ namespace ts {
|
||||
if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") {
|
||||
return getWScriptSystem();
|
||||
}
|
||||
else if (typeof module !== "undefined" && module.exports) {
|
||||
else if (typeof process !== "undefined" && process.nextTick && !process.browser) {
|
||||
// process and process.nextTick checks if current environment is node-like
|
||||
// process.browser check excludes webpack and browserify
|
||||
return getNodeSystem();
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in new issue
Block a user