@uni-helper/vite-plugin-uni-pages 0.1.0 → 0.1.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 CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const path = require('path');
6
6
  const MagicString = require('magic-string');
7
7
  const chokidar = require('chokidar');
8
+ const vite = require('vite');
8
9
  const unconfig = require('unconfig');
9
10
  const Debug = require('debug');
10
11
  const lodashEs = require('lodash-es');
@@ -277,7 +278,7 @@ class PageContext {
277
278
  const { relativePath, absolutePath } = page;
278
279
  const routeBlock = await getRouteBlock(absolutePath, this.options);
279
280
  const relativePathWithFileName = relativePath.replace(path.extname(relativePath), "");
280
- const pageMetaDatum = { path: relativePathWithFileName, type: "page" };
281
+ const pageMetaDatum = { path: vite.normalizePath(relativePathWithFileName), type: "page" };
281
282
  if (routeBlock)
282
283
  Object.assign(pageMetaDatum, routeBlock);
283
284
  return pageMetaDatum;
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import path from 'path';
2
2
  import MagicString from 'magic-string';
3
3
  import chokidar from 'chokidar';
4
+ import { normalizePath } from 'vite';
4
5
  import { loadConfig } from 'unconfig';
5
6
  import Debug from 'debug';
6
7
  import { groupBy } from 'lodash-es';
@@ -273,7 +274,7 @@ class PageContext {
273
274
  const { relativePath, absolutePath } = page;
274
275
  const routeBlock = await getRouteBlock(absolutePath, this.options);
275
276
  const relativePathWithFileName = relativePath.replace(path.extname(relativePath), "");
276
- const pageMetaDatum = { path: relativePathWithFileName, type: "page" };
277
+ const pageMetaDatum = { path: normalizePath(relativePathWithFileName), type: "page" };
277
278
  if (routeBlock)
278
279
  Object.assign(pageMetaDatum, routeBlock);
279
280
  return pageMetaDatum;
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.1.0",
4
+ "version": "0.1.1",
5
5
  "packageManager": "pnpm@7.16.1",
6
6
  "description": "File system based routing for uni-app applications using Vite",
7
7
  "author": "KeJun",