meshoptimizer
meshoptimizer copied to clipboard
add es module of gltf/library.js
trafficstars
usage: import * as gltfpack from 'path/to/module.js'
I forgot to comment on this, but this is a little stuck due to node.js only having ES module support in recent versions. I'm not sure if there's a way to refactor this code so that we can have a module that can be imported but still have most of the code in the same file... and I don't think I want to maintain the duplicate JS files here.
Maybe an alternative is to have some simple prepublish step that builds the module.js file from library.js before creating the package, as long as this doesn't introduce new build time dependencies (aka runs in pure node).