-
-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use forge.config.ts in the webpack typescript template (#3012)
* feat!: prefer forge.config.js over package.json config This change affects the `init` and `import` commands. * run lint * fix tests * another test change * fix import * copy over forge.config files rather than mutate base tmpl * i broke a test with rebase * fix lint * feat: typed forge.config.ts * chore: extract utils to @electron-forge/core-utils to remove cyclic dep * chore: update tests for extracted logic in core-utils * chore: fix tests Co-authored-by: Erick Zhao <erick@hotmail.ca> Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
- Loading branch information
1 parent
ab8ea66
commit b80a275
Showing
34 changed files
with
258 additions
and
106 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
64 changes: 28 additions & 36 deletions
64
packages/template/typescript-webpack/tmpl/forge.config.ts
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,43 +1,35 @@ | ||
module.exports = { | ||
import type { ForgeConfig } from '@electron-forge/shared-types'; | ||
import { MakerSquirrel } from '@electron-forge/maker-squirrel'; | ||
import { MakerZIP } from '@electron-forge/maker-zip'; | ||
import { MakerDeb } from '@electron-forge/maker-deb'; | ||
import { MakerRpm } from '@electron-forge/maker-rpm'; | ||
import { WebpackPlugin } from '@electron-forge/plugin-webpack'; | ||
|
||
import { mainConfig } from './webpack.main.config'; | ||
import { rendererConfig } from './webpack.renderer.config'; | ||
|
||
const config: ForgeConfig = { | ||
packagerConfig: {}, | ||
rebuildConfig: {}, | ||
makers: [ | ||
{ | ||
name: '@electron-forge/maker-squirrel', | ||
config: {}, | ||
}, | ||
{ | ||
name: '@electron-forge/maker-zip', | ||
platforms: ['darwin'], | ||
}, | ||
{ | ||
name: '@electron-forge/maker-deb', | ||
config: {}, | ||
}, | ||
{ | ||
name: '@electron-forge/maker-rpm', | ||
config: {}, | ||
}, | ||
], | ||
makers: [new MakerSquirrel({}), new MakerZIP({}, ['darwin']), new MakerRpm({}), new MakerDeb({})], | ||
plugins: [ | ||
{ | ||
name: '@electron-forge/plugin-webpack', | ||
config: { | ||
mainConfig: './webpack.main.config.js', | ||
renderer: { | ||
config: './webpack.renderer.config.js', | ||
entryPoints: [ | ||
{ | ||
html: './src/index.html', | ||
js: './src/renderer.ts', | ||
name: 'main_window', | ||
preload: { | ||
js: './src/preload.ts', | ||
}, | ||
new WebpackPlugin({ | ||
mainConfig, | ||
renderer: { | ||
config: rendererConfig, | ||
entryPoints: [ | ||
{ | ||
html: './src/index.html', | ||
js: './src/renderer.ts', | ||
name: 'main_window', | ||
preload: { | ||
js: './src/preload.ts', | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
}), | ||
], | ||
}; | ||
|
||
export default config; |
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
4 changes: 3 additions & 1 deletion
4
...cript-webpack/tmpl/webpack.main.config.js → ...cript-webpack/tmpl/webpack.main.config.ts
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type IForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const ForkTsCheckerWebpackPlugin: typeof IForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); | ||
|
||
export const plugins = [new ForkTsCheckerWebpackPlugin()]; |
Oops, something went wrong.