Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138192

Build Electron for different environments

$
0
0

Ahoy,

I have an electron app where I currently manually edit an URL in one of my files, depending on which environment (dev, prod, test) I wish to build for. However I would rather like to define that in my script so I don't have to rewrite the URL every time (e.g. electron-builder -w --x64 --ia32 --test or something like that).

As far as I can tell it is possible to have different build files (https://github.com/electron-userland/electron-builder/issues/1109), but I can't quite figure how the setup should be, and furthermore I can't figure how to get the attributes from the build files (e.g. build/publish/url). It seems possible to get icon and name (https://github.com/electron-userland/electron-builder/issues/639), but not url?

package.json

    {... ,
      "build":{
        ... ,
        "publish":[{
          ... ,
          "url": "https://my.website.url"<--- Change on build and fetchable in code?
        }],
      }
    }

I'm sorry if I have missed anything - I consider writing an explicit tutorial somewhere once I've got a hang of this.

Thanks in advance


Viewing all articles
Browse latest Browse all 138192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>