Skip to content

Commit

Permalink
fix: add time logging to bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar committed May 14, 2021
1 parent cece53c commit a4021ac
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/cli/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ export async function preBundle(
): Promise<string> {
const scriptResult = await bundleFile(script, options);

const bundleContent =
`import "${new URL("./mod.ts", Deno.mainModule).href}";\n` +
`$.mainModule = import.meta.url;\n${scriptResult}`;
const bundleContent = `import "${new URL("./mod.ts", Deno.mainModule).href}";
$.mainModule = import.meta.url;
${scriptResult}
if ($.verbose) {
const end = Date.now();
console.log($.bold("time: %ss"), Math.round($.time) / 1000);
}`;

const tmpDir = await Deno.makeTempDir();
const tmpFile = path.join(tmpDir, path.basename(script));
Expand Down

0 comments on commit a4021ac

Please sign in to comment.