@modern-js/server 0.0.0-next-20221117175708 → 0.0.0-next-20221118040500
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @modern-js/server
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-20221118040500
|
|
4
4
|
|
|
5
5
|
### Major Changes
|
|
6
6
|
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
feat: 支持完全自定义 Server,导出 render() 方法用来渲染单个页面
|
|
13
13
|
- 61f21d1e: fix: ignore the entire distPath for pia ssr bundle
|
|
14
14
|
fix: dist 目录的产物不应该被 ts-node 编译
|
|
15
|
+
- ebbeed1e: chore: dev server default cross origin
|
|
16
|
+
chore: 开发环境 Server 默认跨域
|
|
15
17
|
- 14b712da: fix: use consistent alias type and default value across packages
|
|
16
18
|
|
|
17
19
|
fix: 在各个包中使用一致的 alias 类型定义和默认值
|
|
@@ -34,10 +36,10 @@
|
|
|
34
36
|
- Updated dependencies [abf3421a]
|
|
35
37
|
- Updated dependencies [543be955]
|
|
36
38
|
- Updated dependencies [14b712da]
|
|
37
|
-
- @modern-js/server-utils@0.0.0-next-
|
|
38
|
-
- @modern-js/prod-server@0.0.0-next-
|
|
39
|
-
- @modern-js/utils@0.0.0-next-
|
|
40
|
-
- @modern-js/types@0.0.0-next-
|
|
39
|
+
- @modern-js/server-utils@0.0.0-next-20221118040500
|
|
40
|
+
- @modern-js/prod-server@0.0.0-next-20221118040500
|
|
41
|
+
- @modern-js/utils@0.0.0-next-20221118040500
|
|
42
|
+
- @modern-js/types@0.0.0-next-20221118040500
|
|
41
43
|
|
|
42
44
|
## 2.0.0-beta.0
|
|
43
45
|
|
|
@@ -116,8 +116,9 @@ export class ModernDevServer extends ModernServer {
|
|
|
116
116
|
} = this;
|
|
117
117
|
this.addHandler((ctx, next) => {
|
|
118
118
|
// allow hmr request cross-domain, because the user may use global proxy
|
|
119
|
+
ctx.res.setHeader('Access-Control-Allow-Origin', '*');
|
|
120
|
+
|
|
119
121
|
if (ctx.path.includes('hot-update')) {
|
|
120
|
-
ctx.res.setHeader('Access-Control-Allow-Origin', '*');
|
|
121
122
|
ctx.res.setHeader('Access-Control-Allow-Credentials', 'false');
|
|
122
123
|
} // 用户在 devServer 上配置的 headers 不会对 html 的请求生效,加入下面代码,使配置的 headers 对所有请求生效
|
|
123
124
|
|
|
@@ -140,8 +140,9 @@ class ModernDevServer extends _prodServer.ModernServer {
|
|
|
140
140
|
} = this;
|
|
141
141
|
this.addHandler((ctx, next) => {
|
|
142
142
|
// allow hmr request cross-domain, because the user may use global proxy
|
|
143
|
+
ctx.res.setHeader('Access-Control-Allow-Origin', '*');
|
|
144
|
+
|
|
143
145
|
if (ctx.path.includes('hot-update')) {
|
|
144
|
-
ctx.res.setHeader('Access-Control-Allow-Origin', '*');
|
|
145
146
|
ctx.res.setHeader('Access-Control-Allow-Credentials', 'false');
|
|
146
147
|
} // 用户在 devServer 上配置的 headers 不会对 html 的请求生效,加入下面代码,使配置的 headers 对所有请求生效
|
|
147
148
|
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.0-next-
|
|
14
|
+
"version": "0.0.0-next-20221118040500",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/core": "^7.18.0",
|
|
32
32
|
"@babel/register": "^7.17.7",
|
|
33
|
-
"@modern-js/prod-server": "0.0.0-next-
|
|
34
|
-
"@modern-js/server-utils": "0.0.0-next-
|
|
35
|
-
"@modern-js/types": "0.0.0-next-
|
|
36
|
-
"@modern-js/utils": "0.0.0-next-
|
|
33
|
+
"@modern-js/prod-server": "0.0.0-next-20221118040500",
|
|
34
|
+
"@modern-js/server-utils": "0.0.0-next-20221118040500",
|
|
35
|
+
"@modern-js/types": "0.0.0-next-20221118040500",
|
|
36
|
+
"@modern-js/utils": "0.0.0-next-20221118040500",
|
|
37
37
|
"connect-history-api-fallback": "^2.0.0",
|
|
38
38
|
"devcert": "^1.2.2",
|
|
39
39
|
"minimatch": "^3.0.4",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"ws": "^8.2.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@modern-js/core": "0.0.0-next-
|
|
45
|
-
"@modern-js/server-core": "0.0.0-next-
|
|
46
|
-
"@scripts/build": "0.0.0-next-
|
|
47
|
-
"@scripts/jest-config": "0.0.0-next-
|
|
44
|
+
"@modern-js/core": "0.0.0-next-20221118040500",
|
|
45
|
+
"@modern-js/server-core": "0.0.0-next-20221118040500",
|
|
46
|
+
"@scripts/build": "0.0.0-next-20221118040500",
|
|
47
|
+
"@scripts/jest-config": "0.0.0-next-20221118040500",
|
|
48
48
|
"@types/connect-history-api-fallback": "^1.3.5",
|
|
49
49
|
"@types/jest": "^27",
|
|
50
50
|
"@types/minimatch": "^3.0.5",
|