@monkeyplus/flow 5.0.0-rc.27 → 5.0.0-rc.29

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/index.mjs CHANGED
@@ -29,7 +29,7 @@ import { isExternal as isExternal$1, ExternalsDefaults } from 'externality';
29
29
  import { createHash } from 'node:crypto';
30
30
  import MagicString from 'magic-string';
31
31
 
32
- const version = "5.0.0-rc.27";
32
+ const version = "5.0.0-rc.29";
33
33
 
34
34
  let _distDir = dirname(fileURLToPath(import.meta.url));
35
35
  if (_distDir.endsWith("chunks"))
@@ -426,7 +426,10 @@ const viteModule = defineFlowModule({
426
426
  async getContents() {
427
427
  return [
428
428
  "import fs from 'fs';",
429
- `export default ()=>JSON.parse(fs.readFileSync("${file}", 'utf8'))`
429
+ `export default ()=>{
430
+ const manifest =JSON.parse(fs.readFileSync("${file}", 'utf8'));
431
+ return {manifest,base:'${_options.dir}'}
432
+ }`
430
433
  ].join("\n");
431
434
  }
432
435
  });
@@ -1,4 +1,5 @@
1
1
  import logger from "consola";
2
+ import { joinURL } from "ufo";
2
3
  import { generateBundle } from "./injectManifest.mjs";
3
4
  import { defineFlowPlugin } from "#app";
4
5
  import manifest from "#viteManifest";
@@ -6,7 +7,8 @@ export default defineFlowPlugin((flow) => {
6
7
  if (typeof manifest === "function") {
7
8
  flow.hook("page:chunks", (bundle, chunks) => {
8
9
  try {
9
- const chunk = generateBundle(flow.$config.app || {}, manifest(), `client/pages/${bundle}.ts`);
10
+ const data = manifest();
11
+ const chunk = generateBundle(flow.$config.app || {}, data.manifest, joinURL("/", data.base, `${bundle}.ts`).replace("/", ""));
10
12
  if (chunk) {
11
13
  chunks.head.push(chunk.head);
12
14
  chunks.body.push(chunk.body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkeyplus/flow",
3
- "version": "5.0.0-rc.27",
3
+ "version": "5.0.0-rc.29",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -25,9 +25,9 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@monkeyplus/flow-cli": "5.0.0-rc.27",
29
- "@monkeyplus/flow-kit": "5.0.0-rc.27",
30
- "@monkeyplus/flow-schema": "5.0.0-rc.27",
28
+ "@monkeyplus/flow-cli": "5.0.0-rc.29",
29
+ "@monkeyplus/flow-kit": "5.0.0-rc.29",
30
+ "@monkeyplus/flow-schema": "5.0.0-rc.29",
31
31
  "@rollup/plugin-replace": "^4.0.0",
32
32
  "@vueuse/head": "^0.7.6",
33
33
  "c12": "^0.2.7",