@absolutejs/absolute 0.19.0-beta.776 → 0.19.0-beta.777

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/build.js CHANGED
@@ -8681,12 +8681,9 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
8681
8681
  for (const source of sources) {
8682
8682
  if (source.negated)
8683
8683
  continue;
8684
- const root = resolve7(source.base);
8685
- if (!absFile.startsWith(`${root}/`) && absFile !== root)
8686
- continue;
8687
- const relative5 = absFile.slice(root.length + 1) || "";
8688
- const glob = new Bun.Glob(source.pattern);
8689
- if (glob.match(relative5) || glob.match(absFile))
8684
+ const absolutePattern = resolve7(source.base, source.pattern);
8685
+ const glob = new Bun.Glob(absolutePattern);
8686
+ if (glob.match(absFile))
8690
8687
  return true;
8691
8688
  }
8692
8689
  return false;
@@ -8710,12 +8707,25 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
8710
8707
  entry.perFileCandidates.set(file, freshCandidates);
8711
8708
  for (const candidate of freshCandidates)
8712
8709
  incrementCandidateCount(entry, candidate);
8710
+ }, splitGlobAtFirstMeta = (absolutePattern) => {
8711
+ const firstMetaIndex = absolutePattern.search(/[*?{[]/);
8712
+ if (firstMetaIndex === -1) {
8713
+ return { glob: "", root: absolutePattern };
8714
+ }
8715
+ const lastSlashBeforeMeta = absolutePattern.lastIndexOf("/", firstMetaIndex);
8716
+ return {
8717
+ glob: absolutePattern.slice(lastSlashBeforeMeta + 1),
8718
+ root: absolutePattern.slice(0, lastSlashBeforeMeta) || "/"
8719
+ };
8713
8720
  }, collectFilesForSources = async (sources) => {
8714
8721
  const seen = new Set;
8715
8722
  const collected = [];
8716
8723
  const scans = sources.filter((source) => !source.negated).map(async (source) => {
8717
- const root = resolve7(source.base);
8718
- const glob = new Bun.Glob(source.pattern);
8724
+ const absolutePattern = resolve7(source.base, source.pattern);
8725
+ const { glob: relativePattern, root } = splitGlobAtFirstMeta(absolutePattern);
8726
+ if (!relativePattern)
8727
+ return [];
8728
+ const glob = new Bun.Glob(relativePattern);
8719
8729
  const matches = [];
8720
8730
  for await (const relative5 of glob.scan({
8721
8731
  absolute: false,
@@ -17889,5 +17899,5 @@ export {
17889
17899
  build
17890
17900
  };
17891
17901
 
17892
- //# debugId=88D2B49420F3E55264756E2164756E21
17902
+ //# debugId=2BAE1D80155BC85C64756E2164756E21
17893
17903
  //# sourceMappingURL=build.js.map