diff --git a/scripts/postinstall.js b/scripts/postinstall.js index e14b318..0ca5207 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -1,5 +1,12 @@ -// There doesn't appear to be a way to skip `postinstall`, -// as doing `yarn --ignore-scripts` could prevent native packages from building: +// This allows `postinstall` to be skipped via `SKIP_YARN_POSTINSTALL=true`. +// This is useful when building a Docker image because it lets you +// take advantage of cached Docker layers and run Yarn +// only if `package.json` or `yarn.lock` changed, +// and not every time source code is updated: +// https://nodejs.org/en/docs/guides/nodejs-docker-webapp/ +// +// However, there doesn't appear to be a way to skip `postinstall`, +// and doing `yarn --ignore-scripts` could prevent native packages from building: // https://github.com/yarnpkg/yarn/issues/4100 const { execSync } = require("child_process");