vite-plugin-files-server 1.0.2 → 1.0.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/README.md CHANGED
@@ -1 +1,16 @@
1
- # vite-plugin-files-server
1
+ <!--
2
+ * @Author: Varian LIn
3
+ * @Date: 2026-03-11 16:43:38
4
+ * @LastEditors: Varian LIn
5
+ * @LastEditTime: 2026-03-11 17:33:24
6
+ * @Description:
7
+ -->
8
+ # vite-plugin-files-server
9
+
10
+ ##
11
+
12
+ 使用vite进行开发时, 在开发状态下, 将当前工程发布成一个服务, 使得可以便利的访问各个文件夹的静态资源;
13
+
14
+ 同时提供要给文件服务列表, 用来展示各个文件夹下的文件.
15
+
16
+ ## NPM
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "vite-plugin-files-server",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "type": "module",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.mjs",
8
- "types": "./dist/index.d.ts",
6
+ "main": "./plugin/index.js",
7
+ "module": "./plugin/index.mjs",
8
+ "types": "./plugin/index.d.ts",
9
9
  "files": [
10
- "dist"
10
+ "plugin"
11
11
  ],
12
12
  "scripts": {
13
13
  "dev": "tsup --watch",
@@ -409,7 +409,8 @@ function fileServerPlugin(options = {}) {
409
409
  res.end(html);
410
410
  return;
411
411
  } else if (!import_fs.default.existsSync(fullPath)) {
412
- const html = "path not found";
412
+ res.statusCode = 404;
413
+ const html = "404 Not Found";
413
414
  res.setHeader("Content-Type", "text/html");
414
415
  res.end(html);
415
416
  return;
@@ -375,7 +375,8 @@ function fileServerPlugin(options = {}) {
375
375
  res.end(html);
376
376
  return;
377
377
  } else if (!fs.existsSync(fullPath)) {
378
- const html = "path not found";
378
+ res.statusCode = 404;
379
+ const html = "404 Not Found";
379
380
  res.setHeader("Content-Type", "text/html");
380
381
  res.end(html);
381
382
  return;
File without changes
File without changes