Closed siosphere closed 4 years ago
Okay, so, I ran "yarn run pretty" and it changed tons of files in the repo that I didn't touch....so I opted not to run it, I'm not sure why it was updating so many things
Hi after upgrading i get this now:
./node_modules/@projectstorm/geometry/dist/es/Point.js Module not found: Can't resolve 'ml-matrix' in '\node_modules\@projectstorm\geometry\dist\es'
removing node modules and reyarn didnt help
Hi after upgrading i get this now:
./node_modules/@projectstorm/geometry/dist/es/Point.js Module not found: Can't resolve 'ml-matrix' in '\node_modules@projectstorm\geometry\dist\es'
removing node modules and reyarn didnt help
You have to add ml-matrix
to your project's dependencies. Also, if you aren't using mathjs
for anything else, you can remove it.
See this update commit on my project for reference: https://github.com/renato-bohler/logossim/commit/a835d4e009a834c6a627fdf922a22a5dc814bab4
Thanks that worked!
Checklist
What?
This swaps out mathjs for ml-matrix, reducing the bundle size dramatically.
Why?
The geometry package was using mathjs which added ~2MB (10MB unpacked) to final build size, even though we only use a fraction of what mathjs provides.
How?
Because it was only using basic matrix math, swapping it for a much smaller library was easy to do