Skip to content

script-utils/bundlers/esbuild-impl/change-extension-plugin

This module defines an esbuild plugin that changes the extension of JavaScript files after the build process.

FunctionDescription
changeExtensionPluginCreates an esbuild plugin that changes the extension of JavaScript files after the build process.
rewriteImportPathExtensionsRewrites the extension of every import-like path in an emitted module’s text from .ts to the target output extension (.mjs / .cjs), so the multi-file dist/lib build references its real siblings. Covers require('…'), static from "…", and dynamic import("…") occurrences.