vite-plugin-files-server 1.0.0 → 1.0.1
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.cjs +5 -0
- package/dist/index.js +5 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -405,6 +405,11 @@ function fileServerPlugin(options = {}) {
|
|
|
405
405
|
res.setHeader("Content-Type", "text/html");
|
|
406
406
|
res.end(html);
|
|
407
407
|
return;
|
|
408
|
+
} else if (!import_fs.default.existsSync(fullPath)) {
|
|
409
|
+
const html = "path not found";
|
|
410
|
+
res.setHeader("Content-Type", "text/html");
|
|
411
|
+
res.end(html);
|
|
412
|
+
return;
|
|
408
413
|
}
|
|
409
414
|
} catch (e) {
|
|
410
415
|
console.error("File Server Plugin Error:", e);
|
package/dist/index.js
CHANGED
|
@@ -371,6 +371,11 @@ function fileServerPlugin(options = {}) {
|
|
|
371
371
|
res.setHeader("Content-Type", "text/html");
|
|
372
372
|
res.end(html);
|
|
373
373
|
return;
|
|
374
|
+
} else if (!fs.existsSync(fullPath)) {
|
|
375
|
+
const html = "path not found";
|
|
376
|
+
res.setHeader("Content-Type", "text/html");
|
|
377
|
+
res.end(html);
|
|
378
|
+
return;
|
|
374
379
|
}
|
|
375
380
|
} catch (e) {
|
|
376
381
|
console.error("File Server Plugin Error:", e);
|