A plugin for esbuild that enables import assertion syntax (e.g. `import json from './foo.json' assert { type: 'json' }`) in your builds. Current stable version is 1.0.1. This plugin adds the ability to use the TC39 proposal for import assertions, which esbuild does not natively support. It works only with synchronous imports and requires `bundle: true`. Key differentiator: it fills a gap for users who need import assertions without switching to a different bundler like Webpack or Rollup.
npm install esbuild-plugin-import-assertionsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic esbuild build with the import assertions plugin, requiring bundle: true.
Rewrite dynamic import() calls with assertions as static imports if possible, or use an alternative approach.
Set 'bundle: true' in the esbuild options.
Use import() or change the project to ESM (type: 'module' in package.json).
Use named import: import { importAssertPlugin } from 'esbuild-plugin-import-assertions';Convert to static import statements.
No dependency data recorded yet.