Просмотр исходного кода

reorganize build:client script

Yuki Takei 3 лет назад
Родитель
Сommit
f2dad614c0
3 измененных файлов с 26 добавлено и 5 удалено
  1. 4 0
      packages/app/.gitignore
  2. 4 5
      packages/app/package.json
  3. 18 0
      packages/app/tsconfig.build.next.config.json

+ 4 - 0
packages/app/.gitignore

@@ -17,6 +17,10 @@ test/cypress/videos
 /public/uploads
 /tmp/
 
+# transpiled configuration files for production build
+/src/next-i18next.config.js
+/src/utils/next.config.utils.js
+
 # dist (for GROWI v4.x and below)
 /public/*.chunk.js
 /public/*.chunk.js.LICENSE.txt

+ 4 - 5
packages/app/package.json

@@ -4,12 +4,10 @@
   "license": "MIT",
   "scripts": {
     "//// for production": "",
-    "build": "yarn next build",
+    "build": "run-p build:*",
     "start": "yarn next start",
-    "//// for production (obsolete)": "",
-    "start:obsolete": "yarn build && yarn server",
-    "build:obsolete": "run-p build:*",
-    "build:client": "yarn cross-env NODE_ENV=production webpack --config config/webpack.prod.js",
+    "build:client": "yarn next build",
+    "prebuild:client": "yarn cross-env NODE_ENV=production tsc -p tsconfig.build.next.config.json",
     "build:server": "yarn cross-env NODE_ENV=production tsc -p tsconfig.build.server.json && tsc-alias -p tsconfig.build.server.json",
     "clean": "npx -y shx rm -rf dist transpiled",
     "prebuild": "yarn cross-env NODE_ENV=production run-p clean resources:*",
@@ -63,6 +61,7 @@
     "@elastic/elasticsearch7": "npm:@elastic/elasticsearch@^7.17.0",
     "@godaddy/terminus": "^4.9.0",
     "@google-cloud/storage": "^5.8.5",
+    "@growi/core": "^5.1.1-RC.0",
     "@growi/codemirror-textlint": "^5.1.1-RC.0",
     "@growi/plugin-attachment-refs": "^5.1.1-RC.0",
     "@growi/plugin-lsx": "^5.1.1-RC.0",

+ 18 - 0
packages/app/tsconfig.build.next.config.json

@@ -0,0 +1,18 @@
+{
+  "extends": "../../tsconfig.base.json",
+  "compilerOptions": {
+    "noResolve": false,
+    "preserveConstEnums": true,
+    "sourceMap": false,
+    "noEmit": false,
+    "paths": {
+      "~/*": ["./src/*"],
+      "^/*": ["./*"]
+    }
+  },
+  "include": [
+    "src/next-i18next.config.ts",
+    "src/utils/next.config.utils.ts"
+  ],
+  "exclude": ["node_modules"]
+}