Remove postinstall

This commit is contained in:
Minh Nguyen 2020-07-17 00:23:11 +01:00
parent 9d4a5b900c
commit a859638b72
4 changed files with 2 additions and 24 deletions

View File

@ -3,8 +3,7 @@ FROM node:12-alpine
WORKDIR /excalidraw-room
COPY package.json yarn.lock ./
COPY scripts ./scripts
RUN SKIP_YARN_POSTINSTALL=true yarn
RUN yarn
COPY tsconfig.json ./
COPY src ./src

View File

@ -7,7 +7,6 @@
"build": "tsc",
"fix": "yarn prettier --write",
"lint": "yarn prettier --list-different",
"postinstall": "node scripts/postinstall.js",
"prettier": "prettier \"**/*.{ts,md,json,yaml,yml}\"",
"start": "node dist/index.js",
"test": "yarn lint"
@ -40,9 +39,6 @@
"typescript": "3.9.5"
},
"eslintConfig": {
"env": {
"es6": true
},
"extends": [
"prettier"
],

View File

@ -1,16 +0,0 @@
// 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");
if (process.env.SKIP_YARN_POSTINSTALL !== "true") {
execSync("yarnpkg build", { stdio: "inherit" });
}

View File

@ -12,6 +12,5 @@
"resolveJsonModule": true,
"isolatedModules": true,
"outDir": "dist"
},
"include": ["src/**/*"]
}
}