An ESBuild and TSUP plugin (v0.3.1) that imports files as raw text, base64, data URL, binary, or file content via query suffixes like ?raw, ?text, ?base64, ?dataurl, ?binary, and ?file. Supports smart extension resolution and custom loader mappings. Currently stable with monthly releases. Differentiates from similar plugins by supporting multiple output formats, zero-config setup, and compatibility with both esbuild and tsup.
npm install esbuild-rawNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup with ESBuild and import of a file as raw text using the ?raw suffix.
Update to v0.3.1 for backward compatibility fixes.
Test that imports with suffixes work; if not, check for custom resolvers or other plugins.
Add `declare module '*?raw' { const content: string; export default content; }` to a .d.ts file.Use `import code from './utils?raw'` instead of specifying full path.
Upgrade to latest version: `npm install esbuild-raw-plugin@latest`
Ensure `raw()` is included in the esbuild `plugins` array.
Add `declare module '*?raw' { const content: string; export default content; }` to a `.d.ts` file.No dependency data recorded yet.