Skip to content

Commit

Permalink
ESM CORS workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
micahscopes committed Mar 17, 2023
1 parent 8a002f2 commit f478037
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.1",
"description": "SwissGL is a minimalistic wrapper on top of WebGL2 JS API. It's designed to reduce the amount of boilerplate code required to manage GLSL shaders, textures and framebuffers when making procedural visualizations or simulations.",
"main": "swissgl.js",
"module": "swissgl.mjs",
"directories": {
"doc": "docs"
},
Expand Down
4 changes: 3 additions & 1 deletion swissgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ function wrapSwissGL(hook) {
return f;
}

export default function SwissGL(canvas_gl) {
function SwissGL(canvas_gl) {
const gl = canvas_gl.getContext ?
canvas_gl.getContext('webgl2', {alpha:false}) : canvas_gl;
gl.getExtension("EXT_color_buffer_float");
Expand Down Expand Up @@ -642,3 +642,5 @@ export default function SwissGL(canvas_gl) {
};
return glsl;
}

self._SwissGL = SwissGL;
5 changes: 5 additions & 0 deletions swissgl.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'swissgl.js'

const SwissGL = self._SwissGL

export default SwissGL

0 comments on commit f478037

Please sign in to comment.