@nuxt/kit-nightly 4.2.2-29404141.cdce631a → 4.2.2-29404316.81356f85

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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -2
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import { existsSync, readFileSync, promises, lstatSync } from 'node:fs';
10
10
  import { fileURLToPath, pathToFileURL } from 'node:url';
11
11
  import { resolve, relative, join, dirname, normalize, isAbsolute, basename, parse } from 'pathe';
12
12
  import { createJiti } from 'jiti';
13
- import { parseNodeModulePath, interopDefault, resolveModuleExportNames } from 'mlly';
13
+ import { parseNodeModulePath, interopDefault, lookupNodeModuleSubpath, resolveModuleExportNames } from 'mlly';
14
14
  import { resolveModulePath, resolveModuleURL } from 'exsolve';
15
15
  import { isRelative, withTrailingSlash as withTrailingSlash$2 } from 'ufo';
16
16
  import { read, update } from 'rc9';
@@ -788,8 +788,13 @@ async function callModule(nuxtModule, meta = {}, inlineOptions, resolvedModulePa
788
788
  return;
789
789
  }
790
790
  const modulePath = resolvedModulePath || moduleToInstall;
791
+ let entryPath;
791
792
  if (typeof modulePath === "string") {
792
793
  const parsed = parseNodeModulePath(modulePath);
794
+ if (parsed.name) {
795
+ const subpath = await lookupNodeModuleSubpath(modulePath) || ".";
796
+ entryPath = join(parsed.name, subpath === "./" ? "." : subpath);
797
+ }
793
798
  const moduleRoot = parsed.dir ? parsed.dir + parsed.name : await resolvePackageJSON(modulePath, { try: true }).then((r) => r ? dirname(r) : modulePath);
794
799
  nuxt.options.build.transpile.push(normalizeModuleTranspilePath(moduleRoot));
795
800
  const directory = moduleRoot.replace(/\/?$/, "/");
@@ -798,7 +803,7 @@ async function callModule(nuxtModule, meta = {}, inlineOptions, resolvedModulePa
798
803
  }
799
804
  }
800
805
  nuxt.options._installedModules ||= [];
801
- const entryPath = typeof moduleToInstall === "string" ? resolveAlias(moduleToInstall, nuxt.options.alias) : void 0;
806
+ entryPath ||= typeof moduleToInstall === "string" ? resolveAlias(moduleToInstall, nuxt.options.alias) : void 0;
802
807
  if (typeof moduleToInstall === "string" && entryPath !== moduleToInstall) {
803
808
  buildTimeModuleMeta.rawPath = moduleToInstall;
804
809
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/kit-nightly",
3
- "version": "4.2.2-29404141.cdce631a",
3
+ "version": "4.2.2-29404316.81356f85",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -45,7 +45,7 @@
45
45
  "untyped": "^2.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.2-29404141.cdce631a",
48
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.2-29404316.81356f85",
49
49
  "@rspack/core": "1.6.5",
50
50
  "@types/semver": "7.7.1",
51
51
  "hookable": "5.5.3",