@absolutejs/absolute 0.19.0-beta.26 → 0.19.0-beta.27

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
@@ -202274,11 +202274,25 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, TRANSPILABLE, REACT_EXTENSIONS, escape
202274
202274
  }, createModuleServer = (config) => {
202275
202275
  const { projectRoot, vendorPaths } = config;
202276
202276
  const rewriter = buildImportRewriter(vendorPaths);
202277
- return (pathname) => {
202277
+ return async (pathname) => {
202278
202278
  if (pathname.startsWith("/@stub/")) {
202279
- return new Response("export default {}; export {};", {
202279
+ const specifier = decodeURIComponent(pathname.slice("/@stub/".length));
202280
+ let stubCode = `export default {};
202281
+ `;
202282
+ try {
202283
+ const mod = await import(specifier);
202284
+ const names = Object.keys(mod).filter((k) => k !== "default" && k !== "__esModule");
202285
+ if (names.length > 0) {
202286
+ const noops = names.map((n) => `export const ${n} = () => {};`).join(`
202287
+ `);
202288
+ stubCode = `${noops}
202289
+ export default {};
202290
+ `;
202291
+ }
202292
+ } catch {}
202293
+ return new Response(stubCode, {
202280
202294
  headers: {
202281
- "Cache-Control": "no-cache",
202295
+ "Cache-Control": "public, max-age=31536000, immutable",
202282
202296
  "Content-Type": "application/javascript"
202283
202297
  }
202284
202298
  });
@@ -204459,5 +204473,5 @@ export {
204459
204473
  ANGULAR_INIT_TIMEOUT_MS
204460
204474
  };
204461
204475
 
204462
- //# debugId=5EE265A4D3D1840D64756E2164756E21
204476
+ //# debugId=6D0456E07F4F84EF64756E2164756E21
204463
204477
  //# sourceMappingURL=index.js.map