mp-weixin-back 0.0.2 → 0.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/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "mp-weixin-back",
3
- "version": "0.0.2",
3
+ "type": "module",
4
+ "version": "0.0.3",
4
5
  "description": "监听微信小程序的手势返回和页面默认导航栏的返回",
5
6
  "main": "./dist/index.ts",
6
7
  "scripts": {
@@ -15,10 +16,8 @@
15
16
  ],
16
17
  "exports": {
17
18
  ".": {
18
- "import": {
19
- "types": "./dist/index.d.mts",
20
- "default": "./dist/index.mjs"
21
- }
19
+ "types": "./dist/index.d.ts",
20
+ "default": "./dist/index.js"
22
21
  },
23
22
  "./client": {
24
23
  "types": "./client.d.ts"
@@ -33,16 +32,19 @@
33
32
  "@types/babel__generator": "^7.6.8",
34
33
  "@types/node": "^22.9.3",
35
34
  "@vitejs/plugin-vue": "^5.2.0",
36
- "@vue/compiler-sfc": "^3.2.45",
37
35
  "@vue/test-utils": "^2.4.6",
38
36
  "ast-kit": "^1.3.1",
39
37
  "happy-dom": "^15.11.6",
38
+ "json5": "^2.2.3",
40
39
  "tsup": "^8.3.5",
41
40
  "typescript": "^5.7.2",
42
- "vite": "^5.4.11",
43
41
  "vitest": "^2.1.5",
44
42
  "vue": "^3.5.13"
45
43
  },
44
+ "peerDependencies": {
45
+ "@vue/compiler-sfc": "^2.7.0 || ^3.0.0",
46
+ "vite": "^2.0.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0"
47
+ },
46
48
  "lint-staged": {
47
49
  "*": "prettier --write"
48
50
  }
package/src/context.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import path from 'path'
2
2
  import fs from 'fs'
3
+ import JSON5 from 'json5'
3
4
  import { ContextConfig, PagesJson } from '../types'
4
5
  import { transformVueFile } from '../utils'
5
6
 
@@ -20,7 +21,7 @@ export class pageContext {
20
21
  if (!hasPagesJson) return
21
22
  try {
22
23
  const content = await fs.promises.readFile(this.getPagesJsonPath(), 'utf-8')
23
- const pagesContent = JSON.parse(content) as PagesJson
24
+ const pagesContent = JSON5.parse(content) as PagesJson
24
25
  const { pages, subpackages } = pagesContent
25
26
  if (pages) {
26
27
  const mainPages = pages.reduce((acc: string[], current) => {