@uni-helper/vite-plugin-uni-pages 0.2.25 → 0.2.26

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 CHANGED
@@ -15,7 +15,7 @@ const detectIndent = require('detect-indent');
15
15
  const detectNewline = require('detect-newline');
16
16
  const fs = require('node:fs');
17
17
  const promises = require('node:fs/promises');
18
- const lodashUnified = require('lodash-unified');
18
+ const groupBy = require('lodash.groupby');
19
19
  const JSON5 = require('json5');
20
20
  const yaml = require('yaml');
21
21
  const compilerSfc = require('@vue/compiler-sfc');
@@ -31,6 +31,7 @@ const Debug__default = /*#__PURE__*/_interopDefaultCompat(Debug);
31
31
  const detectIndent__default = /*#__PURE__*/_interopDefaultCompat(detectIndent);
32
32
  const detectNewline__default = /*#__PURE__*/_interopDefaultCompat(detectNewline);
33
33
  const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
34
+ const groupBy__default = /*#__PURE__*/_interopDefaultCompat(groupBy);
34
35
  const JSON5__default = /*#__PURE__*/_interopDefaultCompat(JSON5);
35
36
  const fg__default = /*#__PURE__*/_interopDefaultCompat(fg);
36
37
 
@@ -183,7 +184,7 @@ function isTargetFile(path) {
183
184
  return FILE_EXTENSIONS.includes(ext);
184
185
  }
185
186
  function mergePageMetaDataArray(pageMetaData) {
186
- const pageMetaDataObj = lodashUnified.groupBy(pageMetaData, "path");
187
+ const pageMetaDataObj = groupBy__default(pageMetaData, "path");
187
188
  const result = [];
188
189
  for (const path in pageMetaDataObj) {
189
190
  const _pageMetaData = pageMetaDataObj[path];
@@ -366,9 +367,9 @@ class PageContext {
366
367
  async loadUserPagesConfig() {
367
368
  const configSource = this.options.configSource;
368
369
  const { config, sources } = await unconfig.loadConfig({ cwd: this.root, sources: configSource, defaults: {} });
369
- this.pagesGlobConfig = config;
370
+ this.pagesGlobConfig = config.default || config;
370
371
  this.pagesConfigSourcePaths = sources;
371
- debug.options(config);
372
+ debug.options(this.pagesGlobConfig);
372
373
  }
373
374
  async scanPages() {
374
375
  const pageDirFiles = this.options.dirs.map((dir) => {
package/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import detectIndent from 'detect-indent';
11
11
  import detectNewline from 'detect-newline';
12
12
  import fs, { existsSync } from 'node:fs';
13
13
  import { readFile, mkdir, writeFile as writeFile$1 } from 'node:fs/promises';
14
- import { groupBy } from 'lodash-unified';
14
+ import groupBy from 'lodash.groupby';
15
15
  import JSON5 from 'json5';
16
16
  import { parse as parse$1 } from 'yaml';
17
17
  import { parse } from '@vue/compiler-sfc';
@@ -349,9 +349,9 @@ class PageContext {
349
349
  async loadUserPagesConfig() {
350
350
  const configSource = this.options.configSource;
351
351
  const { config, sources } = await loadConfig({ cwd: this.root, sources: configSource, defaults: {} });
352
- this.pagesGlobConfig = config;
352
+ this.pagesGlobConfig = config.default || config;
353
353
  this.pagesConfigSourcePaths = sources;
354
- debug.options(config);
354
+ debug.options(this.pagesGlobConfig);
355
355
  }
356
356
  async scanPages() {
357
357
  const pageDirFiles = this.options.dirs.map((dir) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uni-helper/vite-plugin-uni-pages",
3
3
  "type": "module",
4
- "version": "0.2.25",
4
+ "version": "0.2.26",
5
5
  "description": "File system based routing for uni-app applications using Vite",
6
6
  "author": "KeJun",
7
7
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "detect-newline": "^3.1.0",
45
45
  "fast-glob": "^3.3.2",
46
46
  "json5": "^2.2.3",
47
- "lodash-unified": "^1.0.3",
47
+ "lodash.groupby": "^4.6.0",
48
48
  "magic-string": "^0.30.10",
49
49
  "unconfig": "^0.4.5",
50
50
  "yaml": "^2.4.5"
@@ -52,6 +52,7 @@
52
52
  "devDependencies": {
53
53
  "@antfu/utils": "^0.7.10",
54
54
  "@types/debug": "^4.1.12",
55
+ "@types/lodash.groupby": "^4.6.9",
55
56
  "@types/node": "^20.14.10"
56
57
  },
57
58
  "scripts": {