Separate build script from install script #4458

The --build-from-source flag is now deprecated and will soon
be removed along with the need to define an install script.

This will remove a whole category of package manager
warnings about install scripts and "built" dependencies.

Most people don't need to build sharp from source, but for
those that do, a suitable method is now something like:

$ npm install package-that-depends-on-sharp
$ npm explore sharp -- npm run build
This commit is contained in:
Lovell Fuller
2025-10-07 14:32:44 +01:00
parent 2324d75f7f
commit 1bbee519aa
10 changed files with 65 additions and 46 deletions

View File

@@ -15,7 +15,7 @@ RUN apt-get install -y imagemagick libmagick++-dev graphicsmagick
# Install sharp
RUN mkdir /tmp/sharp
RUN cd /tmp && git clone --single-branch --branch $BRANCH https://github.com/lovell/sharp.git
RUN cd /tmp/sharp && npm install --build-from-source
RUN cd /tmp/sharp && npm install && npm run build
# Install benchmark test
RUN cd /tmp/sharp/test/bench && npm install --omit optional