dev: login on http (and any dynamic import) while proxying vite wasn't working
Massimo Melina committed
Jul 8, 2023 at 19:31 UTC
790cf57e9f0cfb8102b9c8545e129fb62a5dc9b1
1 file changed
+1
-1
src/serveGuiFiles.ts
+1
-1
@@ -67,7 +67,7 @@ function shouldServeApp(ctx: Koa.Context) {
67
function adjustBundlerLinks(ctx: Koa.Context, uri: string, data: string | Buffer) {
68
const ext = extname(ctx.path)
69
return ext && !ext.match(/\.(css|html|js|ts|scss)/) ? data
70
- : String(data).replace(/((?:import | from )['"])\//g, `$1${ctx.state.revProxyPath}${uri}`)
70
+ : String(data).replace(/((?:import[ (]| from )['"])\//g, `$1${ctx.state.revProxyPath}${uri}`)
71
}
72
73
async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {