-
-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(plugin-webpack): use a single webpack compiler for all rende…
…rer process's Shoutout to @mnquintana for proving this was possible :)
- Loading branch information
1 parent
b747c99
commit 674c5f2
Showing
2 changed files
with
92 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,68 @@ | ||
import { Configuration as WebpackConfiguration } from 'webpack'; | ||
|
||
export interface WebpackPluginEntryPoint { | ||
/** | ||
* Relative or absolute path to the HTML template file for this entry point | ||
*/ | ||
html: string; | ||
/** | ||
* Relative or absolute path to the main JS file for this entry point | ||
*/ | ||
js: string; | ||
/** | ||
* Human friendly name of your entry point | ||
*/ | ||
name: string; | ||
/** | ||
* Additional entries to put in the array of entries for this entry point, | ||
* useful if you need to set up things like error reporting as separate | ||
* entry files into your application. | ||
*/ | ||
prefixedEntries?: string[]; | ||
/** | ||
* Additional chunks to include in the outputted HTML file, use this if you | ||
* set up some custom chunking. E.g. CommonChunksPlugin | ||
*/ | ||
additionalChunks?: string[]; | ||
/** | ||
* Information about the preload script for this entry point, if you don't use | ||
* preload scripts you don't need to set this. | ||
*/ | ||
preload?: WebpackPreloadEntryPoint; | ||
} | ||
|
||
export interface WebpackPreloadEntryPoint { | ||
/** | ||
* Relative or absolute path to the preload JS file | ||
*/ | ||
js: string; | ||
/** | ||
* Additional entries to put in the array of entries for this preload script, | ||
* useful if you need to set up things like error reporting as separate | ||
* entry files into your application. | ||
*/ | ||
prefixedEntries?: string[]; | ||
} | ||
|
||
export interface WebpackPluginRendererConfig { | ||
/** | ||
* The webpack config for your renderer process | ||
*/ | ||
config: WebpackConfiguration | string; | ||
|
||
/** | ||
* Array of entry points, these should map to the windows your app needs to | ||
* open. Each window requires it's own entry point | ||
*/ | ||
entryPoints: WebpackPluginEntryPoint[]; | ||
} | ||
|
||
export interface WebpackPluginConfig { | ||
/** | ||
* The webpack config for your main process | ||
*/ | ||
mainConfig: WebpackConfiguration | string; | ||
/** | ||
* Electron Forge webpack configuration for your renderer process | ||
*/ | ||
renderer: WebpackPluginRendererConfig; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters