Skip to content

Commit

Permalink
feat(core): add platform/arch arguments to prePackage hook
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed Oct 18, 2021
1 parent 54e9f43 commit b55a5c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/api/core/src/api/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default async ({
}

await runHook(forgeConfig, 'generateAssets', platform, arch);
await runHook(forgeConfig, 'prePackage');
await runHook(forgeConfig, 'prePackage', platform, arch);

d('packaging with options', packageOpts);

Expand Down
10 changes: 5 additions & 5 deletions packages/plugin/webpack/src/WebpackPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint "no-console": "off" */
import { asyncOra } from '@electron-forge/async-ora';
import PluginBase from '@electron-forge/plugin-base';
import { ElectronProcess, ForgeConfig, ForgeHookFn } from '@electron-forge/shared-types';
import { ElectronProcess, ForgeArch, ForgeConfig, ForgeHookFn, ForgePlatform } from '@electron-forge/shared-types';
import Logger, { Tab } from '@electron-forge/web-multi-logger';
import debug from 'debug';
import fs from 'fs-extra';
Expand Down Expand Up @@ -154,14 +154,14 @@ export default class WebpackPlugin extends PluginBase<WebpackPluginConfig> {
switch (name) {
case 'prePackage':
this.isProd = true;
return async (config: ForgeConfig) => {
return async (config: ForgeConfig, platform: ForgePlatform, arch: ForgeArch) => {
await fs.remove(this.baseDir);
await utils.rebuildHook(
this.projectDir,
await utils.getElectronVersion(this.projectDir, await fs.readJson(path.join(this.projectDir, 'package.json'))),
process.platform,
process.arch,
config.electronRebuildConfig,
platform,
arch,
config.electronRebuildConfig
);
await this.compileMain();
await this.compileRenderers();
Expand Down

0 comments on commit b55a5c4

Please sign in to comment.