forked from RobotWebTools/roslibjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update shim files to use window instead of global (RobotWebTools#286)
The files in /shim is only used in browsers (remapped in the browser field of package.json) when using build tools. Browsers do not have the global propery which is a node thing. Browsers instead have the global namespace window. This commit solve my problem of importing roslib in my application and building with webpack 4 without having webpack shim global = window. Note: updated Gruntfile.js to have jshint read the config file from the closes directory/parent directory and added a new .jshintrc to /shim to lint the files there with a browser environment in mind.
- Loading branch information
Showing
5 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"globals": { | ||
"Blob": true, | ||
"FileReader": true | ||
}, | ||
"browser": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"latedef": false, | ||
"newcap": true, | ||
"noarg": true, | ||
"sub": true, | ||
"undef": true, | ||
"boss": false, | ||
"eqnull": false, | ||
"node": true, | ||
"devel": true, | ||
"strict": false, | ||
"trailing": true, | ||
"quotmark": "single", | ||
"proto": true, | ||
"laxbreak": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = global.WebSocket; | ||
module.exports = window.WebSocket; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
exports.DOMImplementation = global.DOMImplementation; | ||
exports.XMLSerializer = global.XMLSerializer; | ||
exports.DOMParser = global.DOMParser; | ||
exports.DOMImplementation = window.DOMImplementation; | ||
exports.XMLSerializer = window.XMLSerializer; | ||
exports.DOMParser = window.DOMParser; |