question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bundled Application Assets

See original GitHub issue

Version: 21.2.0 Target: Mac and Windows

Hi there, I’m using electron-builder to bundle a game in Electron. I have all the assets in an assets folder that’s getting bundled, but only the .png assets. I was wondering if there is a way to specify bundling .json and .(mp3|wav) file assets as well into the same folder.

Example structure:

app_folder/
assets
├── images
│   └── titlescreen.png
├── sounds
│   └── maintheme.mp3
├── zones
│   └── titlescreen.json
index.html
main.js
renderer.js

package.json

{
  "name": "save-the-princess",
  "version": "0.0.1",
  "main": "main.js",
  "scripts": {
    "build": "tsc",
    "clean": "rm -rf ./dist",
    "commit": "git add --all && git-cz; git push",
    "local-dist": "npm run build; electron-builder -mw --publish never",
    "dist": "electron-builder -mw --publish always",
    "postinstall": "electron-builder install-app-deps",
    "release": "standard-version",
    "start": "npm run build; electron .",
    "watch": "tsc --watch"
  },
  "dependencies": {
    "divine-engine": "^0.4.1",
    "electron-updater": "^4.0.0"
  },
  "devDependencies": {
    "standard-version": "*",
    "commitizen": "*",
    "cz-conventional-changelog": "*",
    "electron": "*",
    "electron-builder": "*",
    "typescript": "*"
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  },
  "build": {
    "productName": "SaveThePrincess",
    "appId": "com.electron.savetheprincess",
    "files": [
      "main.js",
      "renderer.js",
      "index.html"
    ],
    "extraResources": [
      "assets/images/*.png",
      "assets/sounds/*.(wav|mp3)",
      "assets/zones/*.json"
    ],
    "publish": {
      "provider": "github",
      "publishAutoUpdate": true
    }
  },
  "release": {
    "plubins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator"
    ]
  }
}

Also posted on the Zulip chat

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
kzimnycommented, Sep 12, 2019

Try with extraResources:

        "mac": {
            "extraResources": [
                {
                    "from": "assets/*",
                    "to": "your/path",
                    "filter": "*.(wav|mp3|json)"
                }
            ]
        }
0reactions
srepollockcommented, Sep 18, 2019

Closing this issue as it has been resolved in #4206

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage asset bundles from your inventory - ServiceNow Docs
An asset bundle is a grouping of assets and comprises of consumable and hardware assets. Only assets that are in the In stock...
Read more >
Asset Bundling - Frappe Framework
A bundle file is an entry point of an asset that is picked up by the bundler for compilation. For e.g., if there...
Read more >
Flask-Assets — Flask-Assets 0.12 documentation
A bundle is the unit webassets uses to organize groups of media files, which filters to apply and where to store them. Bundles...
Read more >
About Android App Bundles
Game developers who publish their apps with app bundles can use Play Asset Delivery: Google Play's solution for delivering large amounts of game ......
Read more >
Bundling assets | Building Cross-Platform GUI Applications ...
Bundling assets. Go applications are designed to run from a single binary file. This means they can easily be distributed and do not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found