vitrify 0.16.3 → 0.16.4

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.
@@ -1,4 +1,4 @@
1
- import { promises as fs } from 'fs';
1
+ import { existsSync, promises as fs, mkdirSync } from 'fs';
2
2
  import { routesToPaths } from '../../helpers/routes.js';
3
3
  import { appendToHead, addOrReplaceAppDiv } from '../../helpers/utils.js';
4
4
  export const prerender = async ({ outDir, templatePath, manifestPath, entryServerPath, onRendered }) => {
@@ -16,6 +16,10 @@ export const prerender = async ({ outDir, templatePath, manifestPath, entryServe
16
16
  preloadFonts: true
17
17
  });
18
18
  for (const url of paths) {
19
+ const directoryUrl = new URL(url.split('/').slice(0, -1).join('/'), `file://${outDir}`);
20
+ if (!existsSync(directoryUrl.pathname)) {
21
+ mkdirSync(directoryUrl.pathname, { recursive: true });
22
+ }
19
23
  const filename = (url.endsWith('/') ? 'index' : url.replace(/^\//g, '')) + '.html';
20
24
  console.log(`Generating ${filename}`);
21
25
  const ssrContext = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitrify",
3
- "version": "0.16.3",
3
+ "version": "0.16.4",
4
4
  "license": "MIT",
5
5
  "author": "Stefan van Herwijnen",
6
6
  "description": "Vite as your Full Stack development tool",
@@ -55,31 +55,31 @@
55
55
  "esbuild": "^0.24.0",
56
56
  "fastify": "^5.1.0",
57
57
  "glob": "^11.0.0",
58
- "happy-dom": "^15.11.6",
58
+ "happy-dom": "^15.11.7",
59
59
  "is-port-reachable": "^4.0.0",
60
60
  "magic-string": "^0.30.14",
61
61
  "merge-deep": "^3.0.3",
62
62
  "readline": "^1.3.0",
63
63
  "rollup-plugin-visualizer": "^5.12.0",
64
- "sass": "1.81.0",
64
+ "sass": "1.82.0",
65
65
  "ts-node": "^10.9.2",
66
66
  "unplugin-vue-components": "^0.27.5",
67
- "vite": "^6.0.1",
68
- "vite-plugin-pwa": "^0.21.0",
67
+ "vite": "^6.0.3",
68
+ "vite-plugin-pwa": "^0.21.1",
69
69
  "vitefu": "^1.0.4",
70
- "vitest": "^2.1.6",
70
+ "vitest": "^2.1.8",
71
71
  "workbox-window": "^7.3.0"
72
72
  },
73
73
  "devDependencies": {
74
- "@quasar/extras": "^1.16.13",
74
+ "@quasar/extras": "^1.16.15",
75
75
  "@types/connect": "^3.4.38",
76
76
  "@types/glob": "^8.1.0",
77
77
  "@types/merge-deep": "^3.0.3",
78
- "@types/node": "^22.10.0",
78
+ "@types/node": "^22.10.1",
79
79
  "@types/ws": "^8.5.13",
80
80
  "@vue/runtime-core": "^3.5.13",
81
81
  "quasar": "^2.17.4",
82
- "rollup": "^4.27.4",
82
+ "rollup": "^4.28.1",
83
83
  "typescript": "^5.7.2",
84
84
  "vue": "^3.5.13",
85
85
  "vue-router": "^4.5.0"
@@ -1,4 +1,4 @@
1
- import { promises as fs } from 'fs'
1
+ import { existsSync, promises as fs, mkdirSync } from 'fs'
2
2
  import type { OnRenderedHook } from 'src/node/vitrify-config.js'
3
3
  import { routesToPaths } from '../../helpers/routes.js'
4
4
  import { appendToHead, addOrReplaceAppDiv } from '../../helpers/utils.js'
@@ -33,6 +33,14 @@ export const prerender = async ({
33
33
  })
34
34
 
35
35
  for (const url of paths) {
36
+ const directoryUrl = new URL(
37
+ url.split('/').slice(0, -1).join('/'),
38
+ `file://${outDir}`
39
+ )
40
+ if (!existsSync(directoryUrl.pathname)) {
41
+ mkdirSync(directoryUrl.pathname, { recursive: true })
42
+ }
43
+
36
44
  const filename =
37
45
  (url.endsWith('/') ? 'index' : url.replace(/^\//g, '')) + '.html'
38
46
  console.log(`Generating ${filename}`)