소스 검색

Add local web server configuration designed for web editor development

Running `npm run serve` in `platform/javascript/` will start
a web server that uses `bin/` as its root folder. This means you
can extract a compiled web editor ZIP in this folder and immediately
be able to test the web editor.

Headers required for the use of SharedArrayBuffer are automatically
added to every response.

(cherry picked from commit 9ef9bfb12c3bfd5eca3de1f1c21705e89bb577a1)
Hugo Locurcio 3 년 전
부모
커밋
4f1f76c7ce
3개의 변경된 파일3028개의 추가작업 그리고 5개의 파일을 삭제
  1. 3002 1
      platform/javascript/package-lock.json
  2. 5 4
      platform/javascript/package.json
  3. 21 0
      platform/javascript/serve.json

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 3002 - 1
platform/javascript/package-lock.json


+ 5 - 4
platform/javascript/package.json

@@ -2,9 +2,8 @@
   "name": "godot",
   "private": true,
   "version": "1.0.0",
-  "description": "Linting setup for Godot's HTML5 platform code",
+  "description": "Development and linting setup for Godot's HTML5 platform code",
   "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1",
     "docs": "jsdoc --template js/jsdoc2rst/ js/engine/engine.js js/engine/config.js --destination ''",
     "lint": "npm run lint:engine && npm run lint:libs && npm run lint:modules && npm run lint:tools",
     "lint:engine": "eslint \"js/engine/*.js\" --no-eslintrc -c .eslintrc.engine.js",
@@ -15,7 +14,8 @@
     "format:engine": "npm run lint:engine -- --fix",
     "format:libs": "npm run lint:libs -- --fix",
     "format:modules": "npm run lint:modules -- --fix",
-    "format:tools": "npm run lint:tools -- --fix"
+    "format:tools": "npm run lint:tools -- --fix",
+		"serve": "serve"
   },
   "author": "Godot Engine contributors",
   "license": "MIT",
@@ -23,6 +23,7 @@
     "eslint": "^7.28.0",
     "eslint-config-airbnb-base": "^14.2.1",
     "eslint-plugin-import": "^2.23.4",
-    "jsdoc": "^3.6.7"
+    "jsdoc": "^3.6.7",
+    "serve": "^13.0.2"
   }
 }

+ 21 - 0
platform/javascript/serve.json

@@ -0,0 +1,21 @@
+{
+    "public": "../../bin",
+    "headers": [{
+        "source": "**/*",
+        "headers": [
+            {
+                "key": "Cross-Origin-Embedder-Policy",
+                "value": "require-corp"
+            }, {
+                "key": "Cross-Origin-Opener-Policy",
+                "value": "same-origin"
+            }, {
+                "key":  "Access-Control-Allow-Origin",
+                "value": "*"
+            }, {
+                "key": "Cache-Control",
+                "value": "no-store, max-age=0"
+            }
+        ]
+    }]
+}

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.