An esbuild plugin that inlines the contents of static imports matching a configurable filter (default: `inline:` prefix). Current stable version is 1.1.0, with a maintenance status. It offers a simple `transform` callback to process imported file contents (e.g., run Sass, prepend headers), and supports stacking multiple instances for different import prefixes. Unlike generic esbuild plugins, this one is purpose-built for inlining with minimal configuration. Works with esbuild's bundling pipeline and ships TypeScript definitions. Release cadence is low (last release in 2022).
npm install esbuild-plugin-inline-importVerified import paths — ran on the pinned version, not inferred.
Shows basic usage: import plugin, configure with optional filter and transform, and include in esbuild build.
Ensure `inlineImportPlugin()` is the first plugin in the `plugins` array.
Avoid heavy transforms or cache results if possible. Test build performance with and without the plugin.
Only override `namespace` if you fully understand the implications; otherwise rely on the random default.
Use only static `import` statements with the configured filter prefix.
Ensure `inlineImportPlugin()` is the first plugin in the `plugins` array.
Use default import: `import inlineImportPlugin from 'esbuild-plugin-inline-import'` or `const inlineImportPlugin = require('esbuild-plugin-inline-import')`.Run `npm install --save-dev esbuild-plugin-inline-import`.