@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/build.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
  });
@@ -204095,5 +204109,5 @@ export {
204095
204109
  build
204096
204110
  };
204097
204111
 
204098
- //# debugId=B82AAE7439B05C6764756E2164756E21
204112
+ //# debugId=939786484821A09864756E2164756E21
204099
204113
  //# sourceMappingURL=build.js.map