|
@@ -1,5 +1,12 @@
|
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
|
10
|
// https://github.com/yarnpkg/yarn/issues/4100
|
4
|
11
|
|
5
|
12
|
const { execSync } = require("child_process");
|