Skip to content

Commit

Permalink
Add opn cli if no electron support
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrechls committed Jan 11, 2017
1 parent e2c4dd8 commit d691fcb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions template/build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ var webpack = require('webpack')
var config = require('../config/index')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = require('./webpack.dev.conf')
{{#!electron}}
{{#if_eq electron false}}
var opn = require('opn')
{{/electron}}
{{/if_eq}}

// default port where dev server listens for incoming traffic
var port = process.env.PORT || config.dev.port
Expand Down Expand Up @@ -63,9 +63,9 @@ module.exports = app.listen(port, function (err) {
return
}
console.log('Listening at http://localhost:' + port + '\n')
{{#!electron}}
{{#if_eq electron false}}
opn(`http://localhost:${port}`)
{{/electron}}
{{/if_eq}}

{{#electron}}
require('child_process').exec('npm run electron')
Expand Down

0 comments on commit d691fcb

Please sign in to comment.