@uni-helper/vite-plugin-uni-pages 0.2.2 → 0.2.3
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/client.d.ts +4 -5
- package/dist/index.cjs +7 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +7 -2
- package/package.json +1 -1
package/client.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
declare module "virtual:uni-pages" {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}[];
|
|
2
|
+
import { PageMetaDatum } from "./src/types";
|
|
3
|
+
import { SubPackage } from "./src/config/types/index";
|
|
4
|
+
export const pages: PageMetaDatum[];
|
|
5
|
+
export const subPackages: SubPackage[];
|
|
7
6
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -421,12 +421,17 @@ class PageContext {
|
|
|
421
421
|
writeFileSync(this.resolvedPagesJSONPath, pagesJson);
|
|
422
422
|
this.options.onAfterWriteFile(this);
|
|
423
423
|
}
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
virtualModule() {
|
|
425
|
+
const pages = `export const pages = ${this.resolveRoutes()};`;
|
|
426
|
+
const subPackages = `export const subPackages = ${this.resolveSubRoutes()};`;
|
|
427
|
+
return [pages, subPackages].join("\n");
|
|
426
428
|
}
|
|
427
429
|
resolveRoutes() {
|
|
428
430
|
return JSON.stringify(this.pageMetaData, null, 2);
|
|
429
431
|
}
|
|
432
|
+
resolveSubRoutes() {
|
|
433
|
+
return JSON.stringify(this.subPageMetaData, null, 2);
|
|
434
|
+
}
|
|
430
435
|
}
|
|
431
436
|
function getPagePaths(dir, options) {
|
|
432
437
|
const pagesDirPath = slash(path__default.resolve(options.root, dir));
|
package/dist/index.d.ts
CHANGED
|
@@ -661,8 +661,9 @@ declare class PageContext {
|
|
|
661
661
|
mergePageMetaData(): Promise<void>;
|
|
662
662
|
mergeSubPageMetaData(): Promise<void>;
|
|
663
663
|
updatePagesJSON(): Promise<void>;
|
|
664
|
-
virtualModule():
|
|
664
|
+
virtualModule(): string;
|
|
665
665
|
resolveRoutes(): string;
|
|
666
|
+
resolveSubRoutes(): string;
|
|
666
667
|
}
|
|
667
668
|
|
|
668
669
|
declare function invalidatePagesModule(server: ViteDevServer): void;
|
package/dist/index.mjs
CHANGED
|
@@ -407,12 +407,17 @@ class PageContext {
|
|
|
407
407
|
writeFileSync(this.resolvedPagesJSONPath, pagesJson);
|
|
408
408
|
this.options.onAfterWriteFile(this);
|
|
409
409
|
}
|
|
410
|
-
|
|
411
|
-
|
|
410
|
+
virtualModule() {
|
|
411
|
+
const pages = `export const pages = ${this.resolveRoutes()};`;
|
|
412
|
+
const subPackages = `export const subPackages = ${this.resolveSubRoutes()};`;
|
|
413
|
+
return [pages, subPackages].join("\n");
|
|
412
414
|
}
|
|
413
415
|
resolveRoutes() {
|
|
414
416
|
return JSON.stringify(this.pageMetaData, null, 2);
|
|
415
417
|
}
|
|
418
|
+
resolveSubRoutes() {
|
|
419
|
+
return JSON.stringify(this.subPageMetaData, null, 2);
|
|
420
|
+
}
|
|
416
421
|
}
|
|
417
422
|
function getPagePaths(dir, options) {
|
|
418
423
|
const pagesDirPath = slash(path.resolve(options.root, dir));
|