You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

esbuild-plugin-import-assertions

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-import-assertions

A plugin for esbuild to enable import assertions

1.0.1
latest
npmnpm
Version published
Weekly downloads
8
-50%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

esbuild

FAQs

Package last updated on 02 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts