@olenbetong/appframe-vite 4.1.1 → 4.1.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.
Files changed (2) hide show
  1. package/lib/devServer.js +4 -1
  2. package/package.json +3 -3
package/lib/devServer.js CHANGED
@@ -2,7 +2,7 @@ import { Client } from "@olenbetong/appframe-data";
2
2
  import dotenv from "dotenv";
3
3
  import { exists } from "fs-extra";
4
4
  import { JSDOM } from "jsdom";
5
- import { readFile, stat, writeFile } from "node:fs/promises";
5
+ import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
6
6
  import { resolve } from "node:path";
7
7
  import { importJson } from "./importJson.js";
8
8
  import { getStringCache } from "./localization.js";
@@ -155,6 +155,9 @@ export function createDevMiddleware(vite) {
155
155
  if (!html) {
156
156
  html = await getArticleHtml();
157
157
  html = await vite.transformIndexHtml(url ?? "", html);
158
+ if (!(await exists(cacheFile))) {
159
+ await mkdir(cachePath, { recursive: true });
160
+ }
158
161
  await writeFile(cacheFile, html, { encoding: "utf-8" });
159
162
  }
160
163
  res.statusCode = 200;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olenbetong/appframe-vite",
3
- "version": "4.1.1",
3
+ "version": "4.1.3",
4
4
  "description": "Tools to use and deploy Vite applications to Appframe",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  "author": "Bjørnar Vister Hansen <bvh@olenbetong.no>",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@olenbetong/appframe-data": "^0.9.0",
22
+ "@olenbetong/appframe-data": "^0.9.1",
23
23
  "chalk": "^5.3.0",
24
24
  "chokidar": "^3.5.3",
25
25
  "dotenv": "^16.3.1",
@@ -43,5 +43,5 @@
43
43
  "open": "^9.1.0",
44
44
  "tcp-port-used": "^1.0.2"
45
45
  },
46
- "gitHead": "cd010cf9dcd40cda3f30d89fc48d26de17cf2812"
46
+ "gitHead": "2ad28b8da3235c9be70548552cda30997c6a2059"
47
47
  }