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

Make the library npm-compatible #29

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
support node module import GL from 'lightgl.js'
  • Loading branch information
Toan committed May 5, 2019
commit 8ca64426ad0c71f4cbb1c3266b2a745bc1627c33
3 changes: 3 additions & 0 deletions lightgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,9 @@ function addOtherMethods() {
// standard WebGL enums.
var ENUM = 0x12340000;

if (typeof module === 'object' && module.exports) {
module.exports = GL;
}
// src/raytracer.js
// Provides a convenient raytracing interface.

Expand Down
4 changes: 4 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,3 +450,7 @@ function addOtherMethods() {
// A value to bitwise-or with new enums to make them distinguishable from the
// standard WebGL enums.
var ENUM = 0x12340000;

if (typeof module === 'object' && module.exports) {
module.exports = GL;
}