provide react devtools in electron dev builds

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2017-06-04 15:30:44 +01:00
parent 7c13e2d0ab
commit f24c6de245
No known key found for this signature in database
GPG key ID: 004D8FB8D4A7B783
2 changed files with 16 additions and 0 deletions

View file

@ -1,6 +1,7 @@
/* /*
Copyright 2016 Aviral Dasgupta Copyright 2016 Aviral Dasgupta
Copyright 2016 OpenMarket Ltd Copyright 2016 OpenMarket Ltd
Copyright 2017 Michael Telatynski <7t3chguy@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -216,6 +217,20 @@ electron.ipcMain.on('settings_set', function(ev, key, value) {
}); });
electron.app.on('ready', () => { electron.app.on('ready', () => {
if (argv.devtools) {
try {
const { default: installExtension, REACT_DEVELOPER_TOOLS, REACT_PERF } = require('electron-devtools-installer');
installExtension(REACT_DEVELOPER_TOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));
installExtension(REACT_PERF)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));
} catch(e) {console.log(e);}
}
if (vectorConfig.update_base_url) { if (vectorConfig.update_base_url) {
console.log(`Starting auto update with base URL: ${vectorConfig.update_base_url}`); console.log(`Starting auto update with base URL: ${vectorConfig.update_base_url}`);
startAutoUpdate(vectorConfig.update_base_url); startAutoUpdate(vectorConfig.update_base_url);

View file

@ -101,6 +101,7 @@
"css-raw-loader": "^0.1.1", "css-raw-loader": "^0.1.1",
"electron-builder": "^11.2.4", "electron-builder": "^11.2.4",
"electron-builder-squirrel-windows": "^11.2.1", "electron-builder-squirrel-windows": "^11.2.1",
"electron-devtools-installer": "^2.2.0",
"emojione": "^2.2.7", "emojione": "^2.2.7",
"eslint": "^3.14.0", "eslint": "^3.14.0",
"eslint-config-google": "^0.7.1", "eslint-config-google": "^0.7.1",