@nuxt/kit-nightly 5.0.0-29638064.d4eaa421 → 5.0.0-29639197.68e7e57c

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 +11 -1
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -233,13 +233,23 @@ function withTrailingSlash$2(dir) {
233
233
  function createIsIgnored(nuxt = tryUseNuxt()) {
234
234
  return (pathname, stats) => isIgnored(pathname, stats, nuxt);
235
235
  }
236
+ const layerRootsCache = /* @__PURE__ */ new WeakMap();
236
237
  function isIgnored(pathname, _stats, nuxt = tryUseNuxt()) {
237
238
  if (!nuxt) return false;
238
239
  if (!nuxt._ignore) {
239
240
  nuxt._ignore = ignore(nuxt.options.ignoreOptions);
240
241
  nuxt._ignore.add(resolveIgnorePatterns());
241
242
  }
242
- const relativePath = relative(getLayerDirectories(nuxt).map((dirs) => dirs.root).sort((a, b) => b.length - a.length).find((cwd) => pathname.startsWith(cwd)) ?? nuxt.options.rootDir, pathname);
243
+ let cwds = layerRootsCache.get(nuxt);
244
+ if (!cwds) {
245
+ cwds = getLayerDirectories(nuxt).map((dirs) => dirs.root).sort((a, b) => b.length - a.length);
246
+ layerRootsCache.set(nuxt, cwds);
247
+ }
248
+ for (const cwd of cwds) if (pathname.startsWith(cwd)) {
249
+ const relativePath = pathname.slice(cwd.length);
250
+ return !!(relativePath && nuxt._ignore.ignores(relativePath));
251
+ }
252
+ const relativePath = relative(nuxt.options.rootDir, pathname);
243
253
  if (relativePath[0] === "." && relativePath[1] === ".") return false;
244
254
  return !!(relativePath && nuxt._ignore.ignores(relativePath));
245
255
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/kit-nightly",
3
- "version": "5.0.0-29638064.d4eaa421",
3
+ "version": "5.0.0-29639197.68e7e57c",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -42,7 +42,7 @@
42
42
  "untyped": "^2.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-29638064.d4eaa421",
45
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-29639197.68e7e57c",
46
46
  "@rspack/core": "2.0.1",
47
47
  "@types/semver": "7.7.1",
48
48
  "hookable": "6.1.1",