@absolutejs/absolute 0.19.0-beta.844 → 0.19.0-beta.845

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.js CHANGED
@@ -18955,18 +18955,51 @@ var toSafeFileName6 = (specifier) => {
18955
18955
  }));
18956
18956
  const isPrefixOrEqual = (candidate, current) => current === candidate || current.startsWith(`${candidate}/`);
18957
18957
  const otherSpecsFor = (current) => specifiers.filter((spec) => !isPrefixOrEqual(spec, current));
18958
- const results = await Promise.all(entries.map(({ entryPath, specifier }) => bunBuild9({
18959
- entrypoints: [entryPath],
18960
- external: [...FRAMEWORK_EXTERNALS, ...otherSpecsFor(specifier)],
18961
- format: "esm",
18962
- minify: false,
18963
- naming: "[name].[ext]",
18964
- outdir: vendorDir,
18965
- plugins: [createStripPureAnnotationsPlugin()],
18966
- splitting: false,
18967
- target: "browser",
18968
- throw: false
18969
- })));
18958
+ const REQUIRE_CALL_RE = /__require\(\s*["']([^"']+)["']\s*\)/g;
18959
+ const MAX_INLINE_PASSES = 4;
18960
+ const buildEntryWithCjsRequireResolution = async (entryPath, specifier) => {
18961
+ const baseExternals = [
18962
+ ...FRAMEWORK_EXTERNALS,
18963
+ ...otherSpecsFor(specifier)
18964
+ ];
18965
+ const externalsSet = new Set(baseExternals);
18966
+ let lastResult = null;
18967
+ for (let pass = 0;pass < MAX_INLINE_PASSES; pass++) {
18968
+ lastResult = await bunBuild9({
18969
+ entrypoints: [entryPath],
18970
+ external: [...externalsSet],
18971
+ format: "esm",
18972
+ minify: false,
18973
+ naming: "[name].[ext]",
18974
+ outdir: vendorDir,
18975
+ plugins: [createStripPureAnnotationsPlugin()],
18976
+ splitting: false,
18977
+ target: "browser",
18978
+ throw: false
18979
+ });
18980
+ if (!lastResult.success)
18981
+ return lastResult;
18982
+ const output = lastResult.outputs[0];
18983
+ if (!output)
18984
+ return lastResult;
18985
+ const text = await output.text();
18986
+ REQUIRE_CALL_RE.lastIndex = 0;
18987
+ const requiredSpecs = new Set;
18988
+ let match;
18989
+ while ((match = REQUIRE_CALL_RE.exec(text)) !== null) {
18990
+ const requiredSpec = match[1];
18991
+ if (requiredSpec && externalsSet.has(requiredSpec)) {
18992
+ requiredSpecs.add(requiredSpec);
18993
+ }
18994
+ }
18995
+ if (requiredSpecs.size === 0)
18996
+ return lastResult;
18997
+ for (const spec of requiredSpecs)
18998
+ externalsSet.delete(spec);
18999
+ }
19000
+ return lastResult;
19001
+ };
19002
+ const results = await Promise.all(entries.map(({ entryPath, specifier }) => buildEntryWithCjsRequireResolution(entryPath, specifier)));
18970
19003
  const aggregated = {
18971
19004
  success: results.every((result) => result.success),
18972
19005
  logs: results.flatMap((result) => result.logs),
@@ -27948,5 +27981,5 @@ export {
27948
27981
  ANGULAR_INIT_TIMEOUT_MS
27949
27982
  };
27950
27983
 
27951
- //# debugId=2E034E8C589087CA64756E2164756E21
27984
+ //# debugId=04E6614BD238791664756E2164756E21
27952
27985
  //# sourceMappingURL=index.js.map