@blocklet/pages-kit 0.6.7 → 0.6.9
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 +10 -4
- 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 +10 -4
- 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/esm/utils/preload.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { basename } from 'path';
|
|
2
1
|
import { BuiltinModulesGlobalVariableName } from '../../types/builtin';
|
|
3
2
|
export const isRelativeModule = (moduleSpecifier) => {
|
|
4
3
|
if (!moduleSpecifier) {
|
|
@@ -84,20 +83,25 @@ export const createBuiltinModuleTransformer = (ts) => (context) => (file) => {
|
|
|
84
83
|
}));
|
|
85
84
|
return factory.updateSourceFile(file, statements);
|
|
86
85
|
};
|
|
87
|
-
export const createWellKnownChunksTransformer =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
86
|
+
// export const createWellKnownChunksTransformer =
|
|
87
|
+
// (ts: typeof import('typescript')): TransformerFactory<SourceFile> =>
|
|
88
|
+
// (context) =>
|
|
89
|
+
// (file) => {
|
|
90
|
+
// const { factory } = context;
|
|
91
|
+
// // 转换所有导入声明
|
|
92
|
+
// const transformedStatements = file.statements.map((node) => {
|
|
93
|
+
// if (
|
|
94
|
+
// ts.isImportDeclaration(node) &&
|
|
95
|
+
// ts.isStringLiteral(node.moduleSpecifier) &&
|
|
96
|
+
// isRelativeModule(node.moduleSpecifier.text)
|
|
97
|
+
// ) {
|
|
98
|
+
// const moduleSpecifier = node.moduleSpecifier.text;
|
|
99
|
+
// const fileName = basename(moduleSpecifier);
|
|
100
|
+
// const newPath = `/.well-known/chunks/${fileName}`;
|
|
101
|
+
// // 创建新的导入声明
|
|
102
|
+
// return factory.createImportDeclaration(node.modifiers, node.importClause, factory.createStringLiteral(newPath));
|
|
103
|
+
// }
|
|
104
|
+
// return node;
|
|
105
|
+
// });
|
|
106
|
+
// return factory.updateSourceFile(file, transformedStatements);
|
|
107
|
+
// };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { joinURL, withQuery, getQuery } from 'ufo';
|
|
2
|
-
export declare function getComponentMountPoint(name: string):
|
|
2
|
+
export declare function getComponentMountPoint(name: string): string;
|
|
3
3
|
export declare function getMediaKitAbsoluteUrl(url?: string | null): string | null | undefined;
|