fix some rewrites

This commit is contained in:
Toshit Chawda 2025-03-07 19:25:22 -08:00
parent 9f2d22ed37
commit 1e65744f13
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
4 changed files with 7 additions and 5 deletions

View file

@ -32,3 +32,5 @@ try{}catch(e){this.a.log()};
await import("test")
import{c as d,u as g,a as l,r as i,b,d as m,g as p,e as h,f as v,h as k}from"./1e3cB0WW.js";

View file

@ -342,7 +342,7 @@ impl JsChange<'_> {
str: changes![cfg.importfn, "(\"", cfg.base, "\","],
},
Self::MetaFn { .. } => JsChangeInner::Replace {
str: changes![cfg.metafn, "(\"", cfg.base],
str: changes![cfg.metafn, "(\"", cfg.base, "\")"],
},
Self::AssignmentLeft { name, op, .. } => JsChangeInner::Replace {
str: changes![

View file

@ -178,7 +178,7 @@ where
fn visit_import_declaration(&mut self, it: &ImportDeclaration<'data>) {
let text = self.rewrite_url(it.source.value);
self.jschanges.add(Rewrite::Replace {
span: it.source.span,
span: it.source.span.shrink(1),
text,
});
walk::walk_import_declaration(self, it);
@ -193,7 +193,7 @@ where
fn visit_export_all_declaration(&mut self, it: &ExportAllDeclaration<'data>) {
let text = self.rewrite_url(it.source.value);
self.jschanges.add(Rewrite::Replace {
span: it.source.span,
span: it.source.span.shrink(1),
text,
});
}
@ -201,7 +201,7 @@ where
if let Some(source) = &it.source {
let text = self.rewrite_url(source.value);
self.jschanges.add(Rewrite::Replace {
span: source.span,
span: source.span.shrink(1),
text,
});
}

View file

@ -86,7 +86,7 @@ fastify.listen({
port: PORT,
host: "0.0.0.0",
});
console.log(`Listening on port ${PORT}`);
console.log(`Listening on http://localhost:${PORT}/`);
if (!process.env.CI) {
try {
writeFileSync(