Skip to content

Instantly share code, notes, and snippets.

@adi518
Last active September 11, 2017 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adi518/46dd54d28ad9a0d96edae99b588fef6e to your computer and use it in GitHub Desktop.
Save adi518/46dd54d28ad9a0d96edae99b588fef6e to your computer and use it in GitHub Desktop.
Vue Environment Plugin
// Apply in your `main.js` or whatever suits you. ;)
const environment = {
install(Vue) {
Vue.prototype.$isdev = process.env.NODE_ENV === 'development'
Vue.prototype.$isprod = process.env.NODE_ENV === 'production'
Vue.prototype.$istest = process.env.NODE_ENV === 'testing'
}
}
Vue.use(environment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment