Skip to content

support Electron: respect process.env.npm_config_arch & process.env.npm_config_platform #35

@mifi

Description

@mifi

Because in v4 it only downloads the binary for the current operating system arch, how can I now build an electron app that includes the correct ffmpeg binary according to which target platform I am building for?

For example if I want to run electron-builder --mac --win --linux

Before v4, I would just include the correct binary from the right arch directory when building like this:

electron-builder package.json "build":

    "mac": {
...
      "extraResources": [
        "node_modules/ffmpeg-static/bin/darwin/**",
        "node_modules/ffprobe-static/bin/darwin/**"
      ],
    },
    "win": {
...
      "extraResources": [
        "node_modules/ffmpeg-static/bin/win32/x64/**",
        "node_modules/ffprobe-static/bin/win32/x64/**"
      ],
    },

See
https://github.com/mifi/lossless-cut/blob/74439d716db5ff550a1851fa5b58e30ba188c477/package.json#L108

But now this doesn't work. Any tips of how to cleanly solve this? Or isn't electron really supported by this module anymore?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions