Expand comment about postinstall

This commit is contained in:
Minh Nguyen 2020-07-14 23:29:47 +01:00
parent 1a38ad9166
commit 425fb98d70

View File

@ -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");