Skip to content

Commit

Permalink
Use console.time instead of performance (#19)
Browse files Browse the repository at this point in the history
Description of changes

Experiment with switching out the performance API for console.time in an effort to address a downstream deployment error where Cloudflare Pages seemingly does not load the performance API into its runtime.
  • Loading branch information
hawkticehurst committed Jun 24, 2022
1 parent ced87f2 commit aa1f805
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cli/build.ts
Expand Up @@ -5,7 +5,7 @@ import { buildPage } from '../core/buildPage.js';
import { getPageTemplate } from '../core/pageTemplate.js';

export async function build() {
const startTime = performance.now();
console.time('✨ Build complete in');
const cwd = process.cwd();
const buildDirectory = `${cwd}/build`;
const publicDirectory = `${cwd}/public`;
Expand All @@ -19,8 +19,8 @@ export async function build() {

await buildPages(buildDirectory, pagesDirectory);

const buildTime = (performance.now() - startTime).toFixed(3);
console.log(`\n✨ Build complete (in ${buildTime}ms)! ✨`);
console.log();
console.timeEnd('✨ Build complete in');
}

async function buildPages(buildDirectory: string, pagesDirectory: string) {
Expand Down

0 comments on commit aa1f805

Please sign in to comment.