Closed dabreegster closed 2 years ago
Look for additional build tooling when there is a pain point or missing feature, I reckon.
In osm2streets
, the vendoring process was a little more annoying, because there were a few small image files referenced by the JS or CSS. I missed them the first round and only discovered when I was running locally without internet. Is there a simple tool out there to grab all the final distribution files for an NPM package?
Is there a simple tool out there to grab all the final distribution files for an NPM package?
That sounds like just npm
to me :D (or alternative yarn
). It can be used to get the packages, then the whole node_modules
directory can be added to source control (along with the package.json
and yarn.lock
).
ben@ben-xps:~/code/blah$ yarn add leaflet
yarn add v1.22.19
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ leaflet@1.9.2
info All dependencies
└─ leaflet@1.9.2
Done in 0.90s.
ben@ben-xps:~/code/blah$ ls node_modules/leaflet/dist
images leaflet.css leaflet.js leaflet.js.map leaflet-src.esm.js leaflet-src.esm.js.map leaflet-src.js leaflet-src.js.map
See issue for details. I'd love to do something nicer, but for the moment, just manually downloading the 4 files we need and sticking them in this repo seems fine. I only tested locally, but I don't expect any problems with the github pages hosting workflow.