Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esbuild-plugin-native-modules

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-native-modules

Prevent bundling packages that use platform-specific binaries (.node .dll .dylib .so .so1 etc)

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

esbuild-plugin-native-modules

Prevents bundling packages that use platform-specific binaries (.node .dll .dylib .so .so1 etc).

Internally, it copies specified packages traversing symlinks (which would play well with pnpm and workspaces) so the output looks like that:

app
├─── node_modules
│    ├─── sharp
│    │    └─── ...
│    └─── fsevents
│         └─── ...
└─── index.js

Usage:

const natives = require('esbuild-plugin-native-modules');
const esbuild = require('esbuild');
const path = require('path');

(async function () {
  console.time('Done');

  await esbuild.build({
    bundle: true,
    entryPoints: [path.resolve(__dirname, '../index.js')],
    allowOverwrite: true,
    outfile: path.resolve(__dirname, `../build/index.js`),
    target: 'es2019',
    platform: 'node',
    plugins: [natives(['sharp', 'fsevents'])],
  });

  console.timeEnd('Done');
})();

Keywords

FAQs

Package last updated on 22 Nov 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc