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

electron-forge-plugin-dependencies

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-forge-plugin-dependencies

Help Electron Forge Vite/Webpack project collect dependencies

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
58
increased by190%
Maintainers
0
Weekly downloads
 
Created
Source

electron-forge-plugin-dependencies

Help Electron Forge Vite/Webpack project collect dependencies.

NPM version NPM Downloads

Install

npm i -D electron-forge-plugin-dependencies

Usage

forge.config.js

module.exports = {
  plugins: [
    {
      name: 'electron-forge-plugin-dependencies',
      config: {/* config */},
    },
  ],
};

forge.config.ts

import type { ForgeConfig } from '@electron-forge/shared-types';
import { DependenciesPlugin } from 'electron-forge-plugin-dependencies';

const config: ForgeConfig = {
  plugins: [
    new DependenciesPlugin({/* config */}),
  ],
};

export default config;

API (Define)

export interface DependenciesPluginConfig {
  /**
   * The dependencies package by Electron Forge, default to the `dependencies` in the current project's package.json.
   */
  dependencies?: string[]
  /**
   * Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it.
   * Can also return a `Promise` that resolves to `true` or `false` (or pass in an `async` function).
   */
  filter?: (src: string, dest: string) => boolean | Promise<boolean>
}

Why

Oftentimes, Electron Forge cannot build some third-party modules properly, especially C/C++ native modules. This is because they cannot be properly processed by Vite/Webpack, but they can be loaded normally by Node.js with the require function.
In order to ensure that an Electron application can work properly, we need to collect them into the application's node_modules. This seems stupid, but it works.

Keywords

FAQs

Package last updated on 25 Sep 2024

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