@next-core/brick-container 3.18.13 → 3.18.15
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/dist/core.7fae79f4.js +2 -0
- package/dist/core.7fae79f4.js.map +1 -0
- package/dist/index.html +1 -1
- package/dist/{main.d9e7c247.css → main.ae9a8b0a.css} +1 -1
- package/dist/{main.0c468acb.js → main.f5ea9fee.js} +2 -2
- package/dist/{main.0c468acb.js.map → main.f5ea9fee.js.map} +1 -1
- package/dist/{polyfill.bc23f4fb.js → polyfill.2fc9a9dc.js} +1 -1
- package/dist/preview/core.94e2cf9e.js +1 -0
- package/dist/preview/core.94e2cf9e.js.map +1 -0
- package/dist/preview/index.html +1 -1
- package/dist/preview/{main.0b281c6c.js → main.04c54d60.js} +1 -1
- package/dist/preview/{main.0b281c6c.js.map → main.04c54d60.js.map} +1 -1
- package/dist/vendors.12b330c4.js +2 -0
- package/package.json +6 -6
- package/serve/index.js +13 -5
- package/serve/middlewares/standaloneBootstrapJson.js +1 -0
- package/serve/utils/shouldServeAsIndexHtml.js +3 -2
- package/dist/core.a95ff0db.js +0 -2
- package/dist/core.a95ff0db.js.map +0 -1
- package/dist/preview/core.514e0e11.js +0 -1
- package/dist/preview/core.514e0e11.js.map +0 -1
- package/dist/vendors.f1390456.js +0 -2
- /package/dist/{vendors.f1390456.js.LICENSE.txt → vendors.12b330c4.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/brick-container",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.15",
|
|
4
4
|
"description": "Brick Container Server",
|
|
5
5
|
"homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/brick-container",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"@next-api-sdk/api-gateway-sdk": "^1.1.0",
|
|
54
54
|
"@next-api-sdk/micro-app-standalone-sdk": "^1.1.0",
|
|
55
55
|
"@next-core/build-next-bricks": "^1.23.0",
|
|
56
|
-
"@next-core/easyops-runtime": "^0.12.
|
|
56
|
+
"@next-core/easyops-runtime": "^0.12.18",
|
|
57
57
|
"@next-core/http": "^1.2.6",
|
|
58
58
|
"@next-core/i18n": "^1.0.62",
|
|
59
|
-
"@next-core/loader": "^1.6.
|
|
60
|
-
"@next-core/preview": "^0.7.
|
|
61
|
-
"@next-core/runtime": "^1.54.
|
|
59
|
+
"@next-core/loader": "^1.6.7",
|
|
60
|
+
"@next-core/preview": "^0.7.17",
|
|
61
|
+
"@next-core/runtime": "^1.54.12",
|
|
62
62
|
"@next-core/test-next": "^1.1.5",
|
|
63
63
|
"@next-core/theme": "^1.5.4",
|
|
64
64
|
"@next-core/types": "^1.12.1",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"@next-core/runtime": "*",
|
|
75
75
|
"@next-core/utils": "*"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "910762b07eccf013728a8e5f963af6ad794c9f16"
|
|
78
78
|
}
|
package/serve/index.js
CHANGED
|
@@ -55,6 +55,8 @@ for (const middleware of middlewares) {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
const proxy = getProxy(env, getRawIndexHtml);
|
|
59
|
+
|
|
58
60
|
const browseHappyHtml = "browse-happy.html";
|
|
59
61
|
|
|
60
62
|
if (useLocalContainer) {
|
|
@@ -66,7 +68,7 @@ if (useLocalContainer) {
|
|
|
66
68
|
|
|
67
69
|
// Serve index.html
|
|
68
70
|
app.use(baseHref, async (req, res, next) => {
|
|
69
|
-
await serveIndexHtml(req, res, next, true);
|
|
71
|
+
await serveIndexHtml(req, res, next, true, !!proxy);
|
|
70
72
|
});
|
|
71
73
|
|
|
72
74
|
// Serve browse-happy.html
|
|
@@ -74,14 +76,20 @@ if (useLocalContainer) {
|
|
|
74
76
|
res.sendFile(path.join(distDir, browseHappyHtml));
|
|
75
77
|
});
|
|
76
78
|
|
|
79
|
+
const staticHandler = express.static(distDir);
|
|
77
80
|
// Serve static files
|
|
78
|
-
app.use(baseHref,
|
|
81
|
+
app.use(baseHref, (req, res, next) => {
|
|
82
|
+
if (req.path === "/") {
|
|
83
|
+
next();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
return staticHandler(req, res, next);
|
|
87
|
+
});
|
|
79
88
|
|
|
80
89
|
// Serve static files in next-core for new standalone apps.
|
|
81
90
|
app.use(`${baseHref}sa-static/-/core/0.0.0/`, express.static(distDir));
|
|
82
91
|
}
|
|
83
92
|
|
|
84
|
-
const proxy = getProxy(env, getRawIndexHtml);
|
|
85
93
|
if (proxy) {
|
|
86
94
|
for (const { context, onProxyReq, onProxyRes, ...options } of proxy) {
|
|
87
95
|
app.use(
|
|
@@ -139,8 +147,8 @@ liveReloadServer(env);
|
|
|
139
147
|
* @param {import("express").Request} req
|
|
140
148
|
* @param {import("express").Response} res
|
|
141
149
|
*/
|
|
142
|
-
async function serveIndexHtml(req, res, next, isHome) {
|
|
143
|
-
if (!shouldServeAsIndexHtml(req, isHome)) {
|
|
150
|
+
async function serveIndexHtml(req, res, next, isHome, proxiedHome) {
|
|
151
|
+
if (!shouldServeAsIndexHtml(req, isHome, proxiedHome)) {
|
|
144
152
|
next();
|
|
145
153
|
return;
|
|
146
154
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {import("express").Request} req
|
|
3
3
|
* @param {boolean} isHome
|
|
4
|
+
* @param {boolean} proxiedHome
|
|
4
5
|
* @returns {boolean}
|
|
5
6
|
*/
|
|
6
|
-
export function shouldServeAsIndexHtml(req, isHome) {
|
|
7
|
+
export function shouldServeAsIndexHtml(req, isHome, proxiedHome) {
|
|
7
8
|
return (
|
|
8
9
|
req.method === "GET" &&
|
|
9
10
|
(isHome
|
|
10
|
-
? req.path === "/"
|
|
11
|
+
? !proxiedHome && req.path === "/"
|
|
11
12
|
: ![
|
|
12
13
|
"/api/",
|
|
13
14
|
"/sa-static/",
|