esbuild-plugin-import-assertions
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

esbuild-plugin-import-assertions

The esbuild-plugin-import-assertions plugin import assertion behavior for esbuild.

Installation

This package is available on npm under the name esbuild-plugin-import-assertions and can be installed with npm, yarn or however else you consume dependencies.

Example commands:

npm:

npm i esbuild-plugin-import-assertions

yarn:

yarn add esbuild-plugin-import-assertions

Usage

To use the plugin you must use the JavaScript API for running esbuild. An example configuration is below

import { importAssertPlugin } from 'esbuild-plugin-import-assertions';
import { build } from 'esbuild';

build({
  entryPoints: ['./app.ts'],
  bundle: true,
  outfile: './lib/out.js',
  plugins: [importAssertPlugin],
  target: ['chrome100']
}).catch(() => process.exit(1))

A current limitation of the plugin is that you must set esbuild's bundle option to true. Likewise, asynchronous imports are not currently supported.

Package Sidebar

Install

npm i esbuild-plugin-import-assertions

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

8.37 kB

Total Files

14

Last publish

Collaborators

  • keithamus
  • calebdwilliams