greggman / twgl.js

A Tiny WebGL helper Library
http://twgljs.org
MIT License
2.61k stars 258 forks source link

twgl-base package.json refers to non-existent `module` file #227

Closed lionello closed 10 months ago

lionello commented 10 months ago

https://github.com/greggman/twgl.js/blob/4cf3d973b79807d09f52115ec5c4930c3c10dc04/npm/base/package.json#L7

This causes errors when running with vite:

$ npm run build

> c64ify@0.1.0 build
> vite build

vite v4.4.9 building for production...
✓ 22 modules transformed.
✓ built in 271ms
[commonjs--resolver] Failed to resolve entry for package "twgl-base.js". The package may have incorrect main/module/exports specified in its package.json.
error during build:
Error: Failed to resolve entry for package "twgl-base.js". The package may have incorrect main/module/exports specified in its package.json.

Remove the line with module from package.json fixed the build. By the way, types also refers to a non-existent file, but this doesn't seem to affect the build.

greggman commented 10 months ago

I'll look into fixing it but as quick fix, if you're using any builder that does tree shaking then there isn't much point to using to use base over full right? It should throw away anything you aren't using.

greggman commented 10 months ago

updated v5.5.3