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

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
@@ -202161,20 +202161,13 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, TRANSPILABLE, REACT_EXTENSIONS, escape
202161
202161
  return { dynamicRegex, fromRegex, lookup, sideEffectRegex };
202162
202162
  }, rewriteImports2 = (code, filePath, projectRoot, rewriter) => {
202163
202163
  let result = code;
202164
- if (rewriter) {
202165
- const replacer = (_match, prefix, specifier, suffix) => {
202166
- const webPath = rewriter.lookup.get(specifier);
202167
- if (!webPath)
202168
- return _match;
202164
+ const bareSpecifierRe = /((?:from|import)\s*["'])([^"'./][^"']*)(["'])/g;
202165
+ result = result.replace(bareSpecifierRe, (_match, prefix, specifier, suffix) => {
202166
+ const webPath = rewriter?.lookup.get(specifier);
202167
+ if (webPath)
202169
202168
  return `${prefix}${webPath}${suffix}`;
202170
- };
202171
- rewriter.fromRegex.lastIndex = 0;
202172
- rewriter.sideEffectRegex.lastIndex = 0;
202173
- rewriter.dynamicRegex.lastIndex = 0;
202174
- result = result.replace(rewriter.fromRegex, replacer);
202175
- result = result.replace(rewriter.sideEffectRegex, replacer);
202176
- result = result.replace(rewriter.dynamicRegex, replacer);
202177
- }
202169
+ return `${prefix}/@stub/${encodeURIComponent(specifier)}${suffix}`;
202170
+ });
202178
202171
  const fileDir = dirname7(filePath);
202179
202172
  result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => {
202180
202173
  const absPath = resolve17(fileDir, relPath);
@@ -202282,6 +202275,14 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, TRANSPILABLE, REACT_EXTENSIONS, escape
202282
202275
  const { projectRoot, vendorPaths } = config;
202283
202276
  const rewriter = buildImportRewriter(vendorPaths);
202284
202277
  return (pathname) => {
202278
+ if (pathname.startsWith("/@stub/")) {
202279
+ return new Response("export default {}; export {};", {
202280
+ headers: {
202281
+ "Cache-Control": "no-cache",
202282
+ "Content-Type": "application/javascript"
202283
+ }
202284
+ });
202285
+ }
202285
202286
  if (!pathname.startsWith(SRC_PREFIX))
202286
202287
  return;
202287
202288
  const relPath = pathname.slice(SRC_PREFIX.length);
@@ -204458,5 +204459,5 @@ export {
204458
204459
  ANGULAR_INIT_TIMEOUT_MS
204459
204460
  };
204460
204461
 
204461
- //# debugId=68253C78B51987BF64756E2164756E21
204462
+ //# debugId=5EE265A4D3D1840D64756E2164756E21
204462
204463
  //# sourceMappingURL=index.js.map