Add env in context

This commit is contained in:
Sébastien Chopin 2016-12-04 19:15:11 +01:00
parent a30ce76b0c
commit 87789b8748
2 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,9 @@ export function getContext (context) {
isDev: <%= isDev %>, isDev: <%= isDev %>,
<%= (store ? 'store: context.store,' : '') %> <%= (store ? 'store: context.store,' : '') %>
route: (context.to ? context.to : context.route), route: (context.to ? context.to : context.route),
error: context.error error: context.error,
base: '<%= router.base %>',
env: <%= JSON.stringify(env) %>
} }
const next = context.next const next = context.next
ctx.params = ctx.route.params || {} ctx.params = ctx.route.params || {}

View File

@ -174,6 +174,7 @@ function * generateRoutesAndFiles () {
base: this.options.router.base, base: this.options.router.base,
linkActiveClass: this.options.router.linkActiveClass linkActiveClass: this.options.router.linkActiveClass
}, },
env: this.options.env,
head: this.options.head, head: this.options.head,
store: this.options.store, store: this.options.store,
css: this.options.css, css: this.options.css,