@vuepress/core
Advanced tools
Comparing version 2.0.0-beta.47 to 2.0.0-beta.48
@@ -23,3 +23,4 @@ "use strict"; | ||
// page data file content | ||
let content = `export const data = ${JSON.stringify(page.data, null, 2)}\n`; | ||
let content = `export const data = JSON.parse(${JSON.stringify(JSON.stringify(page.data))}) | ||
`; | ||
// inject HMR code | ||
@@ -26,0 +27,0 @@ if (app.env.isDev) { |
@@ -6,5 +6,5 @@ "use strict"; | ||
/** | ||
* Transform a page object to a route item | ||
* Resolve page route item | ||
*/ | ||
const transformPageToRouteItem = ({ key, path, pathInferred, filePathRelative, routeMeta, }) => { | ||
const resolvePageRouteItem = ({ key, path, pathInferred, filePathRelative, routeMeta, }) => { | ||
// paths that should redirect to this page, use set to dedupe | ||
@@ -41,34 +41,7 @@ const redirectsSet = new Set(); | ||
const preparePagesRoutes = async (app) => { | ||
const routeItems = app.pages.map(transformPageToRouteItem); | ||
const routeItems = app.pages.map(resolvePageRouteItem); | ||
const content = `\ | ||
import { Vuepress } from '@vuepress/client' | ||
const routeItems = [\ | ||
export const pagesRoutes = [\ | ||
${routeItems.map((routeItem) => `\n ${JSON.stringify(routeItem)},`).join('')} | ||
] | ||
export const pagesRoutes = routeItems.reduce( | ||
(result, [name, path, meta, redirects]) => { | ||
result.push( | ||
{ | ||
name, | ||
path, | ||
component: Vuepress, | ||
meta, | ||
}, | ||
...redirects.map((item) => ({ | ||
path: item, | ||
redirect: path, | ||
})) | ||
) | ||
return result | ||
}, | ||
[ | ||
{ | ||
name: '404', | ||
path: '/:catchAll(.*)', | ||
component: Vuepress, | ||
} | ||
] | ||
) | ||
`; | ||
@@ -75,0 +48,0 @@ await app.writeTemp('internal/pagesRoutes.js', content); |
@@ -23,3 +23,3 @@ "use strict"; | ||
let content = `\ | ||
export const siteData = ${JSON.stringify(app.siteData, null, 2)} | ||
export const siteData = JSON.parse(${JSON.stringify(JSON.stringify(app.siteData))}) | ||
`; | ||
@@ -26,0 +26,0 @@ // inject HMR code |
{ | ||
"name": "@vuepress/core", | ||
"version": "2.0.0-beta.47", | ||
"version": "2.0.0-beta.48", | ||
"description": "Core package of VuePress", | ||
@@ -25,6 +25,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@vuepress/client": "2.0.0-beta.47", | ||
"@vuepress/markdown": "2.0.0-beta.47", | ||
"@vuepress/shared": "2.0.0-beta.47", | ||
"@vuepress/utils": "2.0.0-beta.47", | ||
"@vuepress/client": "2.0.0-beta.48", | ||
"@vuepress/markdown": "2.0.0-beta.48", | ||
"@vuepress/shared": "2.0.0-beta.48", | ||
"@vuepress/utils": "2.0.0-beta.48", | ||
"gray-matter": "^4.0.3", | ||
@@ -31,0 +31,0 @@ "toml": "^3.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86970
2471
+ Added@vuepress/client@2.0.0-beta.48(transitive)
+ Added@vuepress/markdown@2.0.0-beta.48(transitive)
+ Added@vuepress/shared@2.0.0-beta.48(transitive)
+ Added@vuepress/utils@2.0.0-beta.48(transitive)
- Removed@vuepress/client@2.0.0-beta.47(transitive)
- Removed@vuepress/markdown@2.0.0-beta.47(transitive)
- Removed@vuepress/shared@2.0.0-beta.47(transitive)
- Removed@vuepress/utils@2.0.0-beta.47(transitive)