4
头图

One line of command turns any website into desktop software

In the past, it took a lot of manpower and time to develop a desktop software. Now with the emergence of Electron, the development threshold has been greatly simplified. Today, I will introduce you a tool that allows you to turn a website into an installable desktop software within 5 minutes.

Tools needed

The effect is as follows


Installation tool

  1. download

    # gitee
    git clone https://gitee.com/wallace5303/electron-egg.git
  2. Install

    # 提升安装速度,使用国内镜像
    npm config set registry https://registry.npm.taobao.org
    
    # 进入目录 ./electron-egg/
    npm install
  3. Configure website

    # 编辑文件 
    ./electron/config.js
    
    # 配置网站地址
    remoteUrl: {
        enable: true, // 启用:true
        url: 'https://discuz.chat/' // 任意网址
    },
  4. Packaged into executable programs (windows, macOS, linux) are all supported

    # 打包 (windows版本)
    npm run build-w (32位)
    npm run build-w-64 (64位)
    
    # 打包 (mac版本)
    npm run build-m
    npm run build-m-arm64 (m1芯片架构)
    
    # 打包 (linux版本)
    npm run build-l
  5. The installation package is here

    ./out/安装包.exe (dmg、dep等)
  6. Come and try the effect ^_^

More usage

View electron-egg tutorial


哆啦好梦
370 声望403 粉丝

electron-egg框架作者,喜欢唱、跳、rap、篮球,music ......