@blocklet/pages-kit 0.6.7 → 0.6.8
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/lib/cjs/builtin/utils.js +9 -3
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/inject-global-components.js +2 -0
- package/lib/cjs/utils/preload.js +0 -2
- package/lib/cjs/utils/typescript/builtin-module-transformer.js +23 -20
- package/lib/esm/builtin/utils.js +9 -3
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/inject-global-components.js +2 -0
- package/lib/esm/utils/preload.js +0 -2
- package/lib/esm/utils/typescript/builtin-module-transformer.js +22 -18
- package/lib/types/builtin/utils.d.ts +1 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/types/api.d.ts +13 -12
- package/lib/types/types/core.d.ts +1 -0
- package/lib/types/utils/typescript/builtin-module-transformer.d.ts +0 -1
- package/package.json +2 -2
package/lib/cjs/builtin/utils.js
CHANGED
|
@@ -9,11 +9,17 @@ Object.defineProperty(exports, "joinURL", { enumerable: true, get: function () {
|
|
|
9
9
|
Object.defineProperty(exports, "withQuery", { enumerable: true, get: function () { return ufo_2.withQuery; } });
|
|
10
10
|
Object.defineProperty(exports, "getQuery", { enumerable: true, get: function () { return ufo_2.getQuery; } });
|
|
11
11
|
function getComponentMountPoint(name) {
|
|
12
|
+
let mountPoints = globalThis.blocklet?.componentMountPoints || [];
|
|
13
|
+
// 如果是在 server 端,则从环境变量中获取 mount points
|
|
12
14
|
if (typeof window === 'undefined') {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
try {
|
|
16
|
+
mountPoints = JSON.parse(process.env.BLOCKLET_MOUNT_POINTS || '[]');
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
// ignore error
|
|
20
|
+
}
|
|
15
21
|
}
|
|
16
|
-
return
|
|
22
|
+
return mountPoints?.find((i) => i.name === name || i.did === name)?.mountPoint || '';
|
|
17
23
|
}
|
|
18
24
|
function getMediaKitAbsoluteUrl(url) {
|
|
19
25
|
if (url && url.startsWith('mediakit://') && typeof window !== 'undefined') {
|