Frequently Asked Questions
Why does the menubar appear when running in development mode, but disappear when packaged?
Based on a comment from @MarshallOfSound:
When you're running in "development mode" (for example,
electron /path/to/app), Electron uses the
default_app codepath to run your app, which also provides a default menubar. When the app is
packaged, Electron runs your app directly. To have a menubar that's consistent between development
and packaged modes, you'll need to define it yourself.
Why isn't my
ignore option working?
Why isn't the relative path in my app code working?
AppName ├── package.json ├── data │ └── somedata.json └── src └── main.js
src/main.js, you would access
data/somedata.json similar to this:
const path = require('path'); const jsonFilename = path.resolve(__dirname, '..', 'data', 'somedata.json'); console.log(require(jsonFilename));
How do I set an icon on Linux?
The docs for
already show how to set an icon on your
BrowserWindow, but your dock/taskbar may not use that and
instead use the
Icon value in your
.desktop file. The Linux distributable creators
can help you set/distribute the appropriate icon in that case.