esbuild plugin that allows importing modules as bundled ESM strings via the `?rawbundle` query suffix. Version 0.2.2 is the latest stable release. This plugin processes imports like `import raw from 'jquery?rawbundle'` and returns the esbuild-bundled output as a default string export, using the specified esbuild options. It is maintained for esbuild plugin ecosystem integration. Differentiators: built on top of esbuild's internal bundling, supports any format/platform, and provides raw bundled content for dynamic use cases like code injection or embedding.
npm install esbuild-plugin-rawbundleNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using esbuild-plugin-rawbundle to bundle a dependency as a raw string import via the ?rawbundle query.
Ensure your imports use the `?rawbundle` suffix exactly.
Do not set `write: true` in esbuildOptions passed to the plugin.
None.
Ensure esbuild is installed and version matches plugin requirements.
None.
npm install --save-dev esbuild-plugin-rawbundle
Use `import rawBundlePlugin from 'esbuild-plugin-rawbundle'` and ensure package.json has `"type": "module"`.
Ensure plugins array contains the result of rawBundlePlugin(options), not a different object.
Add appropriate loader to esbuildOptions, e.g., `rawBundlePlugin({ esbuildOptions: { loader: { '.html': 'text' } } })`.No dependency data recorded yet.