@vue-wordpress/nuxt
Advanced tools
Comparing version 1.0.6 to 1.0.7
25
index.js
@@ -8,2 +8,5 @@ import path from 'path' | ||
// It is under extensions, because this.addPlugin adds plugin at the beginning of the array | ||
const config = (moduleOptions && Object.keys(moduleOptions).length > 0) | ||
? moduleOptions | ||
: this.options.wpJson | ||
@@ -13,17 +16,17 @@ this.addPlugin({ | ||
filename: 'wpjson.js', | ||
options: (moduleOptions && Object.keys(moduleOptions).length > 0) | ||
? moduleOptions | ||
: this.options.wpJson | ||
options: config | ||
}) | ||
const r = routes(true) | ||
this.nuxt.options.router.extendRoutes = (nuxtRoutes, resolve) => { | ||
nuxtRoutes.push(...r.map((route) => { | ||
let cmp = route.component.replace('../', 'node_modules/@vue-wordpress/core/') | ||
return { ...route, component: resolve(cmp) } | ||
})) | ||
if(config.router === true) { | ||
const r = routes(true) | ||
this.nuxt.options.router.extendRoutes = (nuxtRoutes, resolve) => { | ||
nuxtRoutes.push(...r.map((route) => { | ||
let cmp = route.component.replace('../', 'node_modules/@vue-wordpress/core/') | ||
return { ...route, component: resolve(cmp) } | ||
})) | ||
} | ||
} | ||
} |
{ | ||
"name": "@vue-wordpress/nuxt", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "💫 Wordpress REST API plugin for Nuxt.js with out-of-box routing and data handling 💫", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
7632
50