-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix require for Node.js (Fixes #8559) #8560
Conversation
Thank you so much for the pull request @jimmyangel! I noticed this is your first pull request and I wanted to say welcome to the Cesium community! The Pull Request Guidelines is a handy reference for making sure your PR gets accepted quickly, so make sure to skim that.
Reviewers, don't forget to make sure that:
|
Source/Core/Resource.js
Outdated
@@ -1902,7 +1902,7 @@ import TrustedServers from './TrustedServers.js'; | |||
|
|||
// Specifically use the Node version of require to avoid conflicts with the global | |||
// require defined in the built version of Cesium. | |||
var nodeRequire = global.require; // eslint-disable-line | |||
var nodeRequire = global.require ? global.require : require; // eslint-disable-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we use ES6, you can just remove the nodeRequire
variable and comment above it and just replace it with require
directly in this function.
This will most likely have to all change again for Node 13, but there are bigger issues that need to be addressed there too.
Ok, I will try that later today or sometime tomorrow.
Thank you,
Ricardo
…On Wed, Jan 29, 2020 at 7:32 AM Matthew Amato ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Source/Core/Resource.js
<#8560 (comment)>
:
> @@ -1902,7 +1902,7 @@ import TrustedServers from './TrustedServers.js';
// Specifically use the Node version of require to avoid conflicts with the global
// require defined in the built version of Cesium.
- var nodeRequire = global.require; // eslint-disable-line
+ var nodeRequire = global.require ? global.require : require; // eslint-disable-line
Now that we use ES6, you can just remove the nodeRequire variable and
comment above it and just replace it with require directly in this
function.
This will most likely have to all change again for Node 13, but there are
bigger issues that need to be addressed there too.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8560>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABUGUQMEXLGMSGS6SZRRSVTRAGOQJANCNFSM4KJ3YJEA>
.
|
Hi @mramato, I made the change but there is a conflict in the contributors file :) Thanks, Ricardo |
@jimmyangel I could have sworn I merged this already, but thanks again for the PR. It will be part of the CesiumJS release on Monday. |
No description provided.