meshoptimizer icon indicating copy to clipboard operation
meshoptimizer copied to clipboard

add es module of gltf/library.js

Open 1d10t opened this issue 2 years ago • 1 comments
trafficstars

usage: import * as gltfpack from 'path/to/module.js'

1d10t avatar Jun 15 '23 22:06 1d10t

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).

zeux avatar Oct 07 '23 01:10 zeux