Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

Commit

Permalink
add vue-devtools in electron app
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Feb 15, 2017
1 parent d0e00a4 commit 592c1b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions template/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ function createWindow () {
const index = isDev ? `http://localhost:4000` : `file://${path.join(__dirname, 'dist/index.html')}`
mainWindow.loadURL(index)

// Open the DevTools.
mainWindow.webContents.openDevTools()
if (isDev) {
// Open the DevTools.
const installExtension = require('electron-devtools-installer')
installExtension.default(installExtension.VUEJS_DEVTOOLS)
.then(name => console.log(`Added Extension: ${name}`))
.catch(err => console.log('An error occurred: ', err))
}

// Emitted when the window is closed.
mainWindow.on('closed', function () {
Expand Down
1 change: 1 addition & 0 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<%_ if (electron) { -%>
"electron": "^1.4.15",
"electron-builder": "^13.7.0",
"electron-devtools-installer": "^1.1.5",
<%_ } -%>
"vbuild": "^6.0.0"
},
Expand Down

0 comments on commit 592c1b0

Please sign in to comment.