An esbuild plugin that exports the last modified timestamp of specific files during the build process. Version 2.0.4 is the latest stable release, with no known breaking changes since v2.0.0. It returns a Unix timestamp (milliseconds) for requested files, integrated as a virtual module. Differentiator: simple, focused utility for cache busting or build-time file info without manual file system reads.
npm install esbuild-plugin-filelastmodifiedNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up the esbuild plugin and use virtual module imports to get file modification timestamps.
Ensure the import path matches the namespace configuration, e.g., 'my-ns:./file.js' if namespace is 'my-ns'.
Use Math.floor(timestamp / 1000) to get seconds.
Import the files you need timestamps for, even if they are not directly used in code.
Explicitly import any file you need timestamps for to ensure rebuilds trigger.
Use the correct import: import { fileLastModifiedPlugin } from 'esbuild-plugin-filelastmodified'Run npm install esbuild-plugin-filelastmodified --save-dev