You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

postinstall.js 708B

12345678910111213141516
  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:
  10. // https://github.com/yarnpkg/yarn/issues/4100
  11. const { execSync } = require("child_process");
  12. if (process.env.SKIP_YARN_POSTINSTALL !== "true") {
  13. execSync("yarnpkg build", { stdio: "inherit" });
  14. }