@v-long/vite-plugin-view-name-map 0.1.0 → 0.1.2

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/package.json +8 -7
  2. package/types/virtual.d.ts +20 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-long/vite-plugin-view-name-map",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Vite plugin to generate view-name-map from Vue SFC defineOptions",
5
5
  "keywords": [
6
6
  "vite",
@@ -10,16 +10,17 @@
10
10
  ],
11
11
  "author": "v-long",
12
12
  "license": "MIT",
13
- "main": "dist/index.cjs.js",
14
- "module": "dist/index.esm.js",
15
- "types": "dist/index.d.ts",
13
+ "main": "dist/cjs/index.js",
14
+ "module": "dist/esm/index.js",
15
+ "types": "dist/types/index.d.ts",
16
16
  "files": [
17
- "dist"
17
+ "dist",
18
+ "types"
18
19
  ],
19
20
  "exports": {
20
21
  ".": {
21
- "import": "./dist/index.esm.js",
22
- "require": "./dist/index.cjs.js"
22
+ "import": "./dist/esm/index.js",
23
+ "require": "./dist/cjs/index.js"
23
24
  }
24
25
  },
25
26
  "peerDependencies": {
@@ -0,0 +1,20 @@
1
+ /**
2
+ * virtual:view-name-map 的基础类型声明
3
+ *
4
+ * 设计原则:
5
+ * - 插件侧不包含任何业务信息
6
+ * - 仅提供可被业务侧增强的类型锚点
7
+ */
8
+ declare module 'virtual:view-name-map' {
9
+ /**
10
+ * 视图 name 映射表类型
11
+ * key:规范化路径
12
+ * value:组件 defineOptions 中声明的 name
13
+ */
14
+ export type ViewNameMap = Record<string, string>;
15
+
16
+ /**
17
+ * 构建期生成的视图 name 映射表
18
+ */
19
+ export const viewNameMap: ViewNameMap;
20
+ }