New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

webpack-sandbox-external-plugin

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

webpack-sandbox-external-plugin

Webpack plugin to treat a module as an external that's Electron sandbox safe.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Webpack Sandbox External Plugin

This webpack plugin treats modules as externals in a way that doesn't cause errors when their required in an Electron sandbox.

It is heavily based on webpack's internal Webpack plugin.

Instead of outputting code like:

module.exports = require('keytar');

It outputs code like this for externals:

if (!process.sandboxed) module.exports = require('keytar');

Install

yarn add -D webpack-sandbox-external-plugin

Usage

Add the plugin to your webpack config. For example:

const SandboxExternalPlugin = require('webpack-sandbox-external-plugin');

module.exports = {
  plugins: [
    new SanboxSafeExternalsPlugin(
      'commonjs', // output type
      ['sqlite3', 'keytar'], // modules to externalize
    ),
  ],
};

:warning: Only works for commonjs outputs, currently.

Keywords

webpack

FAQs

Package last updated on 05 Aug 2020

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