Last active
September 11, 2017 14:36
-
-
Save adi518/46dd54d28ad9a0d96edae99b588fef6e to your computer and use it in GitHub Desktop.
Vue Environment Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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