const BASE_URL = function () { switch (process.env.FLYLOCAL_ENV) { case "prod": return process.env.PROD_ENV; case "dev": return process.env.DEV_ENV; case "local": return "http://" + process.env.LOCAL_IP + ":" + process.env.LOCAL_PORT; default: break; } } export default ({ app }, inject) => { // Inject $hello(msg) in Vue, context and store. inject('BASE_URL', () => BASE_URL()) inject('hello', msg => console.log(`Hello ${msg}!`)) }