Browse Source

Remove postinstall

master
Minh Nguyen 5 years ago
parent
commit
a859638b72
4 changed files with 2 additions and 24 deletions
  1. 1
    2
      Dockerfile
  2. 0
    4
      package.json
  3. 0
    16
      scripts/postinstall.js
  4. 1
    2
      tsconfig.json

+ 1
- 2
Dockerfile View File

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

+ 0
- 4
package.json View File

@@ -7,7 +7,6 @@
7 7
     "build": "tsc",
8 8
     "fix": "yarn prettier --write",
9 9
     "lint": "yarn prettier --list-different",
10
-    "postinstall": "node scripts/postinstall.js",
11 10
     "prettier": "prettier \"**/*.{ts,md,json,yaml,yml}\"",
12 11
     "start": "node dist/index.js",
13 12
     "test": "yarn lint"
@@ -40,9 +39,6 @@
40 39
     "typescript": "3.9.5"
41 40
   },
42 41
   "eslintConfig": {
43
-    "env": {
44
-      "es6": true
45
-    },
46 42
     "extends": [
47 43
       "prettier"
48 44
     ],

+ 0
- 16
scripts/postinstall.js View File

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

+ 1
- 2
tsconfig.json View File

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

Loading…
Cancel
Save