title: Set baseURL from .env in VueAxios
body: <p>I am using a standard <a href="https://github.com/vuejs-templates/webpack" rel="noreferrer">Vue starer webpack template</a> with VueAxios installed. I want to configure axios using .env variable when building with <code>dev</code> command. I have everything set up within <code>/config/index.js</code>:</p>
  
  <pre><code>const devEnv = require('./dev.env')
  module.exports = {
  ...
      host: devEnv.host || 'localhost',
      port: devEnv.port || 8080,
  ...
  }
  </code></pre>
  
  <p>Then I define my host and port in <code>dev.env.js</code> in the same directory and it all works fine.</p>
  
  <pre><code>const dotenv = require('dotenv').config({path: '../.env'})
  
  let host = process.env.VUE_HOST;
  let port = +process.env.VUE_PORT;
  
  module.exports = merge(prodEnv, {
      NODE_ENV: '"development"',
      host,
      port
  })
  </code></pre>
  
  <p>But the problem is that I can't access host value within <code>src/main.js</code> of my Vue app.</p>
  
  <p>If I try to do it like this I get an error that </p>
  
  <blockquote>
    <p>vue is not defined</p>
  </blockquote>
  
  <pre><code>import axios from 'axios'
  import VueAxios from 'vue-axios'
  ...
  Vue.use(VueAxios, axios)
  Vue.axios.defaults.baseURL = `http://${process.env.host}:${process.env.port}`;
  </code></pre>
  
  <p>Though the port works fine, the host does not and throws an error.</p>