Three.js: Lighter pakage.json dependencies (remove puppeteer by default)

Created on 10 May 2020  路  4Comments  路  Source: mrdoob/three.js

Description of the problem

Some of the developers cloning three.js repo without the intention to contribute. This is happening because they want to make tree-shake library or modify core for your own purposes in projects.

The idea is to introduce to two additional commands and suggest in console to install puppeteer only those developer who want to take screenshots in PRs.

"make-install": "npm i -D [email protected] pngjs pixelmatch image-output serve-handler failonlyreporter",
"make-clean": "npm un puppeteer pngjs pixelmatch image-output serve-handler failonlyreporter",

But by doing so we modifying package.json after npm run make-install and facing another problem: we need to say to contributors not to add package.json or package-lock.json, which is relatively easy but little bit uncomfortable. I wonder if exist any safe way to keep package.json the same after install.

This idea is consistent with #19321 #19326

Most helpful comment

An option would be to put a package.json for the screenshot tool into a subdirectory. Users who need to run it can run npm install in that directory; others would not. Dependencies from the parent folder are automatically available in the subdirectory.

All 4 comments

An option would be to put a package.json for the screenshot tool into a subdirectory. Users who need to run it can run npm install in that directory; others would not. Dependencies from the parent folder are automatically available in the subdirectory.

The solution was simple. Need to rethink this, +150mb is annoying.

Ty.

Solved, sanks.

Was this page helpful?
0 / 5 - 0 ratings