How to add folders and files to electron build using electron-builder

前端 未结 3 733
悲哀的现实
悲哀的现实 2021-01-02 12:49

I am creating an electron which running react generated from create-react-app. Then i add nedbjs(a persistence database) and camojs(ODM for nedb) as dependency. To connect r

3条回答
  •  甜味超标
    2021-01-02 13:33

    To add a file or folder on your electron build folder, you can add the extraFiles options on package.json. Here is an example to copy a "credential" directory:

    "build": {
      "appId": "com.example.electron-boilerplate",
      "files": [
        "app/**/*",
        "node_modules/**/*",
        "package.json"
      ],
      "directories": {
        "buildResources": "resources"
      },
      "extraFiles": [
        "credentials"
      ],
      "publish": null
    },
    

    And then

    $ npm run release // as usual
    

    Hope it will help

提交回复
热议问题