nuxt-typed-router 2.0.1 → 2.0.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.
package/dist/module.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "nuxt": "^3.0.0-rc.1",
6
6
  "bridge": false
7
7
  },
8
- "version": "2.0.1"
8
+ "version": "2.0.2"
9
9
  }
package/dist/module.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { fileURLToPath } from 'url';
2
- import { extendPages, defineNuxtModule } from '@nuxt/kit';
1
+ import { extendPages, defineNuxtModule, createResolver } from '@nuxt/kit';
3
2
  import chalk from 'chalk';
4
3
  import logSymbols from 'log-symbols';
5
4
  import prettier from 'prettier';
6
5
  import fs from 'fs';
6
+ import { fileURLToPath } from 'url';
7
7
  import { dirname, resolve } from 'pathe';
8
8
  import mkdirp from 'mkdirp';
9
9
  import { camelCase } from 'lodash-es';
@@ -642,11 +642,10 @@ const module = defineNuxtModule({
642
642
  setup(moduleOptions, nuxt) {
643
643
  const srcDir = nuxt.options.srcDir;
644
644
  const { plugin } = moduleOptions;
645
+ const { resolve } = createResolver(import.meta.url);
645
646
  nuxt.options.alias = {
646
647
  ...nuxt.options.alias,
647
- "@typed-router": fileURLToPath(
648
- new URL(`${nuxt.options.rootDir}/.nuxt/typed-router`, import.meta.url)
649
- )
648
+ "@typed-router": resolve(`${nuxt.options.rootDir}/.nuxt/typed-router`)
650
649
  };
651
650
  nuxt.hook("pages:extend", () => createTypedRouter({ srcDir, nuxt, plugin }));
652
651
  createTypedRouter({ srcDir, nuxt, plugin });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-typed-router",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Provide autocompletion for pages route names generated by Nuxt router",
5
5
  "type": "module",
6
6
  "main": "./dist/module.cjs",