const bravePort = process.env.BRAVE_PORT || 8080
const createScript = function (scriptPath) {
  return new Promise(function (resolve, reject) {
    var script = document.createElement('script')
    script.type = 'text/javascript'
    script.src = scriptPath.replace(/\{port\}/, bravePort)
    script.async = true
    script.onload = resolve
    script.onerror = reject
    document.body.appendChild(script)
  })
}
createScript('http://localhost:{port}/webpack-dev-server.js').catch(function () {
  document.querySelector('#setupError').style.display = 'block'
}).then(function () {
  createScript('http://localhost:{port}/built/app.entry.js')
})

const bravePort = process.env.BRAVE_PORT || 8080
const createScript = function (scriptPath) {
  return new Promise(function (resolve, reject) {
    var script = document.createElement('script')
    script.type = 'text/javascript'
    script.src = scriptPath.replace(/\{port\}/, bravePort)
    script.async = true
    script.onload = resolve
    script.onerror = reject
    document.body.appendChild(script)
  })
}
createScript('http://localhost:{port}/built/app.entry.js')
createScript('http://localhost:{port}/webpack-dev-server.js').catch(function () {
  document.querySelector('#setupError').style.display = 'block'
})

Fix dev app init for Windows
Fix dev app init for Windows

Having it load entry.js only after the other script is loading is
causing problems in init on slow machines (or my Windows VM).

The devserver doesn't need to be included first, it's just for live
realoading.

Auditors: da39a3ee5e6b4b0d3255bfef95601890afd80709@diracdeltas
