Transpilation bug, changes `;` to `,`
renhiyama opened this issue · 2 comments
renhiyama commented
My code:
import Surreal from "surrealdb.js";
const db = new Surreal(Deno.env.get("DB_URL"));
await db.signin({
user: Deno.env.get("DB_USER"),
pass: Deno.env.get("DB_PASSWORD"),
});
await db.use("test", "test");
export default db;
The code it compiles into:
import e from"https://deno.land/x/surrealdb/mod.ts";const t=new e(Deno.env.get("DB_URL"));await t.signin({user:Deno.env.get("DB_USER"),pass:Deno.env.get("DB_PASSWORD")}),await t.use("test","test");export default t;
(Do note that my code searches and replaces module names and replaces them with their urls. And I do use terser to minify the code.)
The bug is after "DB_PASSWORD" in the compiled code. it shows ,
instead of ;
alangpierce commented
Hi @renhiyama , thanks for the report. I suspect that this might be an issue in terser or some other part of your build process; running your code through Sucrase in the playground doesn't have the issue you described:
If it does still seem like a bug in Sucrase, could you provide the exact config and input/output code? Thanks!
renhiyama commented
Ah, it is definitely terser's problem. I have made an issue over theirs. Sorry for disturbing you.