Skip to content
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

Usage of library in Node #25

Closed
syt123450 opened this issue Feb 7, 2018 · 5 comments
Closed

Usage of library in Node #25

syt123450 opened this issue Feb 7, 2018 · 5 comments
Assignees

Comments

@syt123450
Copy link
Owner

We need to explore how to use our library after download from npm, and how to combine it with Threejs.

@syt123450
Copy link
Owner Author

Now I found that I can import and use three js through npm in this way:

npm install three

in js file:
var THREE = require('three');
var scene = new THREE.Scene();
console.log(scene);

@syt123450
Copy link
Owner Author

@zchholmes

@zchholmes
Copy link
Collaborator

@syt123450

  1. Cool. I'm glad you finally agreed on managing THREE with npm.
  2. You probably want to try "stats.js" by using
    npm install stats.js
    to check if the stats.js still work.
  3. I'll try something on my local branch.

@zchholmes
Copy link
Collaborator

Well, though the method work for creating new THREE to the new file, the previous existed THREE or THREE related objects do not work in the module.
i.e. after running the script to build the module, it still has the THREE is not defined error.

Further more, I tried to import three in the "src/Gio.js" file as import {} from "three", but it still doesn't work.

@syt123450
Copy link
Owner Author

using roll to generate module.js now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants