From 8ca64426ad0c71f4cbb1c3266b2a745bc1627c33 Mon Sep 17 00:00:00 2001 From: Toan Date: Sun, 5 May 2019 23:23:20 +0700 Subject: [PATCH] support node module `import GL from 'lightgl.js'` --- lightgl.js | 3 +++ src/main.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lightgl.js b/lightgl.js index 21c6373..d911af1 100644 --- a/lightgl.js +++ b/lightgl.js @@ -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. diff --git a/src/main.js b/src/main.js index d5ba060..02ba670 100644 --- a/src/main.js +++ b/src/main.js @@ -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; +} \ No newline at end of file