{"id":21276,"library":"esbuild-plugin-time","title":"esbuild-plugin-time","description":"A simple esbuild plugin that measures and logs the build time. Current stable version is 1.0.0. It is a lightweight, zero-configuration plugin that wraps esbuild's build process to report duration. No breaking changes known, minimal API surface. Use it to gain insight into build performance with minimal overhead.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/DasRed/esbuild-plugin-time","tags":["javascript","esbuild","plugin","time"],"install":[{"cmd":"npm install esbuild-plugin-time","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-time","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-time","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: the plugin works with esbuild's build API","package":"esbuild","optional":false}],"imports":[{"note":"The package exports a single function as default. Use ESM import. For CommonJS, use dynamic import or wrap with require (not official).","wrong":"const time = require('esbuild-plugin-time')","symbol":"default export (time)","correct":"import time from 'esbuild-plugin-time'"},{"note":"In CommonJS, the default export is not directly accessible; you may need to access .default or rely on the package's CJS compatibility. Use ESM when possible.","wrong":"const time = require('esbuild-plugin-time')","symbol":"require (CommonJS)","correct":"const time = require('esbuild-plugin-time').default || require('esbuild-plugin-time')"},{"note":"The package does not export named 'time', only default. TypeScript users must import the default export. No types provided; use @types/esbuild or define your own.","wrong":"import { time } from 'esbuild-plugin-time'","symbol":"TypeScript usage","correct":"import time from 'esbuild-plugin-time'"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport time from 'esbuild-plugin-time';\n\nawait esbuild.build({\n    entryPoints: ['./src/index.js'],\n    bundle: true,\n    outfile: './dist/index.js',\n    plugins: [\n        time(),\n    ],\n});","lang":"javascript","description":"Shows basic setup: import esbuild and the plugin, then use time() in the plugins array to log build duration."},"warnings":[{"fix":"No workaround. If you need silent builds, consider forking or not using this plugin.","message":"The plugin always logs to console.log; cannot be silenced or redirected.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Create your own type declaration file (e.g., declare module 'esbuild-plugin-time') or use @ts-ignore.","message":"No TypeScript definitions provided; you may encounter type errors if using strict TypeScript.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If using watch mode, expect the timer to reset with each rebuild but no special behavior.","message":"Plugin does not support watch mode; duration is measured only for a single build invocation.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run npm install --save-dev esbuild esbuild-plugin-time","cause":"Package not installed or used without installing esbuild as a dependency.","error":"Cannot find module 'esbuild-plugin-time'"},{"fix":"Use dynamic import: const time = (await import('esbuild-plugin-time')).default; or switch to ESM.","cause":"Using require() in a CommonJS context for an ESM-only package.","error":"require() of ES Module not supported"},{"fix":"Use import time from 'esbuild-plugin-time' (default import).","cause":"Importing as named export 'time' instead of default.","error":"TypeError: time is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}