@uni-helper/vite-plugin-uni-pages 0.2.21 → 0.2.22

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
@@ -244,7 +244,7 @@ function resolveOptions(userOptions, viteRoot = process__default.cwd()) {
244
244
  onAfterWriteFile = () => {
245
245
  }
246
246
  } = userOptions;
247
- const root = viteRoot || slash(process__default.env.VITE_ROOT_DIR) || slash(process__default.cwd());
247
+ const root = viteRoot || slash(process__default.env.VITE_ROOT_DIR || process__default.cwd());
248
248
  const resolvedDirs = resolvePageDirs(dir, root, exclude);
249
249
  const resolvedSubDirs = subPackages.map((dir2) => slash(dir2));
250
250
  const resolvedHomePage = typeof homePage === "string" ? [homePage] : homePage;
@@ -579,7 +579,7 @@ function defineUniPages(config) {
579
579
  async function restart() {
580
580
  return new Promise((resolve) => {
581
581
  const build = node_child_process.spawn(process__default.argv.shift(), process__default.argv, {
582
- cwd: process__default.env.VITE_ROOT_DIR,
582
+ cwd: process__default.env.VITE_ROOT_DIR || process__default.cwd(),
583
583
  detached: true,
584
584
  env: process__default.env
585
585
  });
@@ -593,7 +593,7 @@ async function restart() {
593
593
  function VitePluginUniPages(userOptions = {}) {
594
594
  let ctx;
595
595
  const resolvedPagesJSONPath = path__default.join(
596
- process__default.env.VITE_ROOT_DIR,
596
+ process__default.env.VITE_ROOT_DIR || process__default.cwd(),
597
597
  userOptions.outDir ?? "src",
598
598
  OUTPUT_NAME
599
599
  );
package/dist/index.mjs CHANGED
@@ -229,7 +229,7 @@ function resolveOptions(userOptions, viteRoot = process.cwd()) {
229
229
  onAfterWriteFile = () => {
230
230
  }
231
231
  } = userOptions;
232
- const root = viteRoot || slash(process.env.VITE_ROOT_DIR) || slash(process.cwd());
232
+ const root = viteRoot || slash(process.env.VITE_ROOT_DIR || process.cwd());
233
233
  const resolvedDirs = resolvePageDirs(dir, root, exclude);
234
234
  const resolvedSubDirs = subPackages.map((dir2) => slash(dir2));
235
235
  const resolvedHomePage = typeof homePage === "string" ? [homePage] : homePage;
@@ -564,7 +564,7 @@ function defineUniPages(config) {
564
564
  async function restart() {
565
565
  return new Promise((resolve) => {
566
566
  const build = spawn(process.argv.shift(), process.argv, {
567
- cwd: process.env.VITE_ROOT_DIR,
567
+ cwd: process.env.VITE_ROOT_DIR || process.cwd(),
568
568
  detached: true,
569
569
  env: process.env
570
570
  });
@@ -578,7 +578,7 @@ async function restart() {
578
578
  function VitePluginUniPages(userOptions = {}) {
579
579
  let ctx;
580
580
  const resolvedPagesJSONPath = path.join(
581
- process.env.VITE_ROOT_DIR,
581
+ process.env.VITE_ROOT_DIR || process.cwd(),
582
582
  userOptions.outDir ?? "src",
583
583
  OUTPUT_NAME
584
584
  );
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.21",
4
+ "version": "0.2.22",
5
5
  "description": "File system based routing for uni-app applications using Vite",
6
6
  "author": "KeJun",
7
7
  "license": "MIT",