Skip to content

Commit 175170b

Browse files
committed
Add .env plugin to ensure working former code
1 parent e0f424e commit 175170b

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

nuxt.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ module.exports = {
9292
}
9393
},
9494
plugins: [
95+
{src: '~/plugins/env.js'},
9596
{src: '~/plugins/debug.js', ssr: false},
9697
{src: '~/plugins/raven-client.js', ssr: false},
9798
{src: '~/plugins/api.js'},

plugins/env.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Vue from 'vue'
2+
3+
export default async (context) => {
4+
context.app.$env = context.env
5+
6+
Vue.use({
7+
install (Vue, store) {
8+
Vue.prototype.$env = context.app.$env
9+
}
10+
}, context.store)
11+
12+
return context.app.$env
13+
}

0 commit comments

Comments
 (0)