Skip to content

Misleading in section integrating Electron Packager within README.md. #1235

@zhujin917

Description

@zhujin917

Electron Packager has modified the definition of HookFunction by this commit. But the code below is still using the old syntax.

rebuild/README.md

Lines 100 to 121 in 76b4600

### How can I integrate this into [Electron Packager](https://github.com/electron/packager)?
electron-rebuild provides a function compatible with the [`afterCopy` hook](https://electron.github.io/packager/main/interfaces/Options.html#afterCopy)
for Electron Packager. For example:
```javascript
import packager from "@electron/packager";
import { rebuild } from "@electron/rebuild";
packager({
// … other options
afterCopy: [
(buildPath, electronVersion, platform, arch, callback) => {
rebuild({ buildPath, electronVersion, arch })
.then(() => callback())
.catch((error) => callback(error));
},
],
// … other options
});
```

The current definition of HookFunction can be viewed here.

What's more, the domain of the link pointing to "afterCopy hook" is electron.github.io, its documentation is outdated. I can't find the corresponding repository for that website, nor do I know who maintains it. I think the API documentation for Electron Packager and Electron Rebuild is at the domain packages.electronjs.org. 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions