interface WebpackPluginConfig {
    devContentSecurityPolicy?: string;
    devServer?: Omit<Configuration, "port" | "static" | "setupExitSignals" | "Content-Security-Policy">;
    jsonStats?: boolean;
    loggerPort?: number;
    mainConfig: string | WebpackConfiguration;
    packageSourceMaps?: boolean;
    port?: number;
    renderer: WebpackPluginRendererConfig | WebpackPluginRendererConfig[];
}

Properties

devContentSecurityPolicy?: string

Sets the Content-Security-Policy header for the Webpack development server.

Normally you would want to only specify this as a <meta> tag. However, in development mode, the Webpack plugin uses the devtool: eval-source-map source map setting for efficiency purposes. This requires the 'unsafe-eval' source for the script-src directive that wouldn't normally be recommended to use. If this value is set, make sure that you keep this directive-source pair intact if you want to use source maps.

Default: default-src 'self' 'unsafe-inline' data:; script-src 'self' 'unsafe-eval' 'unsafe-inline' data:

devServer?: Omit<Configuration, "port" | "static" | "setupExitSignals" | "Content-Security-Policy">

Overrides for webpack-dev-server options.

The following options cannot be overridden here:

  • port (use the port config option)
  • static
  • setupExitSignals
  • headers.Content-Security-Policy (use the devContentSecurityPolicy config option)
jsonStats?: boolean

Instructs webpack to emit a JSON file containing statistics about modules, the dependency graph, and various other build information for the main process. This file is located in .webpack/main/stats.json, but is not packaged with your app.

loggerPort?: number

The TCP port for web-multi-logger. Defaults to 9000.

mainConfig: string | WebpackConfiguration

The webpack config for your main process

packageSourceMaps?: boolean

In the event that webpack has been configured with devtool: sourcemap (or any other option which results in .map files being generated), this option will cause the source map files be packaged with your app. By default they are not included.

port?: number

The TCP port for the dev servers. Defaults to 3000.

renderer: WebpackPluginRendererConfig | WebpackPluginRendererConfig[]

Electron Forge webpack configuration for your renderer process

If this property is configured as an array each group of entryPoints is built sequentially such that later indexed renderer configurations can depend on the output of previous ones.

If you want to build multiple targets in parallel please specify multiple entryPoints in a single renderer configuration. Most usecases should not set this to an array.