-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
r80 incorrectly handles "exports" as global #9489
Comments
/ping @Rich-Harris |
Rich-Harris
added a commit
to Rich-Harris/three.js
that referenced
this issue
Aug 15, 2016
Rich-Harris
added a commit
to Rich-Harris/three.js
that referenced
this issue
Aug 16, 2016
Rich-Harris
added a commit
to Rich-Harris/three.js
that referenced
this issue
Aug 16, 2016
mrdoob
pushed a commit
that referenced
this issue
Aug 16, 2016
* alternative fix for #9489 * export BoxGeometry as CubeGeometry
Looks like r80 now correctly bundles everything in the same closure, but other modules (such as /examples/../*controls) still expect a global (rather than a const THREE = require('THREE'), for example). I guess the plan is to move everything over to some kind of module format compatibility? |
@killroy42 here is a related discussion regarding modularization of examples: #9562 |
12 tasks
aardgoose
pushed a commit
to aardgoose/three.js
that referenced
this issue
Oct 7, 2016
* alternative fix for mrdoob#9489 * export BoxGeometry as CubeGeometry
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of the problem
r80 tries to detect a module environment and passes "exports" as global into the factory class. But below that, there is additional code that accesses "THREE" in the global scope, not on exports. So if the environment has module/exports functions and objects, THREE will fail to load, EVEN if there is a THREE empty object in the global scope, since the factory will not write to the global scope, but to exports instead.
This worked fine in r79, which consistently operated in the same scope.
It appears this is a half-way transition to supporting modularization.
My use case is a module loader that "impersonates" exports/module and captures values written there and makes them available via "require".
Current workaround: Load THREE before initializing my module system.
Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
The text was updated successfully, but these errors were encountered: