sundowatch
sundowatch

Reputation: 3103

Yarn Packager Include Folders and Files

I'm working on a desktop application with JavaScript, Nodejs and Electron. And I'm using yarn package manager. I need to add some folders and json files into the package which is created via yarn package command. These are the additional files and folders which're not creating with code.

How can I include them?

Edit: I'm using electron-react-boilerplate. So when I run yarn package these commands are running:

yarn build && electron-builder build --publish never

I want to copy these additional files into release.

Upvotes: 0

Views: 1373

Answers (1)

sundowatch
sundowatch

Reputation: 3103

Maybe someone needs that, I found the solution:

You should set your additional folders/files to package.json as extraResources under the build object:

"extraResources": [
      {
        "from": "node_modules/regedit/vbs",
        "to": "regedit/vbs",
        "filter": [
          "**/*"
        ]
      },
      {
        "from": "app/assets",
        "to": "../app/assets",
        "filter": [
          "**/*"
        ]
      },
      {
        "from": "app/temps",
        "to": "../app/temps",
        "filter": [
          "**/*"
        ]
      }
    ]

Upvotes: 1

Related Questions