Skip to content

Latest commit

 

History

History
87 lines (62 loc) · 2.69 KB

rc-config.md

File metadata and controls

87 lines (62 loc) · 2.69 KB

rc configuration

You can configure advanced Node and Electron options through a rc file. Options are deep merged in, rather than replaced entirely.

Currently the following config options are supported:

  • browserWindow – options to use when creating the BrowserWindow
  • v8 – an object with flags, an array of strings like "--harmony-arrow-function"
  • detachDevTools – a boolean, default true, to create DevTools detached or attached to the main window
  • devToolsExtensions – an array of paths to Chrome DevTool Extensions, see DevTools Extensions for details

By default, config will search for a local .devtoolrc, or looking up the folder tree to root/home directories. See here for details.

You can explicitly pass a config file like so:

devtool src/index.js --config conf/opts.json

Or disable config lookup entirely:

devtool src/index.js --no-config

For example, you can add the following .devtoolrc file in the same directory as your project.

{
  "browserWindow": {
    "webPreferences": {
      "webSecurity": false,
      "webgl": false
    },
    "width": 500,
    "height": 500,
    "show": true,
    "useContentSize": true
  },
  "detachDevTools": false,
  "v8": {
    "flags": [
      "--harmony-arrow-functions"
    ]
  }
}

💡 The .devtoolrc supports comments in JSON.

Some V8 flags may need to be set before initialization. You can pass these as options to electron like so:

devtool src/index.js --js-flags="--harmony-proxies"

DevTools Extensions

The following extensions should work with Electron (and thus devtool).

You can add this to a ~/.devtoolrc file so that it persists across all uses of the app. For example, after cloning the above theme:

{
  "devToolsExtensions": [
    "/path/to/chrome-devtools-zerodarkmatrix-theme/theme-extension"
  ]
}

For themes to work, you also need to open Settings -> Experiments in the DevTools panel and check "Allow custom UI themes". This will persist for future runs.

Theme

Clearing Extensions

Currently, Electron does not remove the theme from the Chrome application cache.

You can paste this in the devtool REPL to find out where the cache is, and then delete the DevTools Extensions file in that folder:

require('electron').remote.require('app').getPath('userData')

Alternatively, you can go to Settings -> General -> Restore Defaults and Reload while using devtool.