provide react devtools in electron dev builds
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
7c13e2d0ab
commit
f24c6de245
2 changed files with 16 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
Copyright 2016 Aviral Dasgupta
|
||||
Copyright 2016 OpenMarket Ltd
|
||||
Copyright 2017 Michael Telatynski <7t3chguy@gmail.com>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (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', () => {
|
||||
|
||||
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) {
|
||||
console.log(`Starting auto update with base URL: ${vectorConfig.update_base_url}`);
|
||||
startAutoUpdate(vectorConfig.update_base_url);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue