Browse Source

Expand comment about `postinstall`

master
Minh Nguyen 5 years ago
parent
commit
425fb98d70
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      scripts/postinstall.js

+ 9
- 2
scripts/postinstall.js View File

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

Loading…
Cancel
Save