vitepress
Advanced tools
Comparing version 0.10.1 to 0.10.2
@@ -0,1 +1,7 @@ | ||
## [0.10.2](https://github.com/vuejs/vitepress/compare/v0.10.1...v0.10.2) (2020-12-31) | ||
### Bug Fixes | ||
- adjust multi sidebar matching logic ([7e4b16e](https://github.com/vuejs/vitepress/commit/7e4b16ee524efc87c150a3d57a3215aac76b3669)) | ||
## [0.10.1](https://github.com/vuejs/vitepress/compare/v0.10.0...v0.10.1) (2020-12-30) | ||
@@ -2,0 +8,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { isArray, ensureSlash, ensureStartingSlash, removeExtention } from '../utils'; | ||
import { isArray, ensureStartingSlash, removeExtention } from '../utils'; | ||
export function isSideBarConfig(sidebar) { | ||
@@ -18,10 +18,6 @@ return sidebar === false || sidebar === 'auto' || isArray(sidebar); | ||
} | ||
// get the very first segment of the path to compare with multiple sidebar keys | ||
// and make sure it's surrounded by slash | ||
path = removeExtention(path); | ||
path = ensureStartingSlash(path).split('/')[1] || '/'; | ||
path = ensureSlash(path); | ||
path = ensureStartingSlash(path); | ||
for (const dir in sidebar) { | ||
// make sure the multi sidebar key is surrounded by slash too | ||
if (path === ensureSlash(dir)) { | ||
// make sure the multi sidebar key starts with slash too | ||
if (path.startsWith(ensureStartingSlash(dir))) { | ||
return sidebar[dir]; | ||
@@ -28,0 +24,0 @@ } |
@@ -18,12 +18,6 @@ "use strict"; | ||
exports.SITE_DATA_REQUEST_PATH = '/' + exports.SITE_DATA_ID; | ||
// this is a path resolver that is passed to vite | ||
// so that we can resolve custom requests that start with /@app or /@theme | ||
// we also need to map file paths back to their public served paths so that | ||
// vite HMR can send the correct update notifications to the client. | ||
function resolveAliases(root, themeDir, userConfig) { | ||
const paths = { | ||
...userConfig.alias, | ||
'/@app': exports.APP_PATH, | ||
'/@theme': themeDir, | ||
'/@default-theme': exports.DEFAULT_THEME_PATH, | ||
'/@shared': exports.SHARED_PATH, | ||
@@ -37,3 +31,6 @@ [exports.SITE_DATA_ID]: exports.SITE_DATA_REQUEST_PATH | ||
})), | ||
{ find: /^vitepress$/, replacement: `${exports.APP_PATH}/exports.js` } | ||
{ | ||
find: /^vitepress$/, | ||
replacement: path_1.default.join(__dirname, '../client/index') | ||
} | ||
]; | ||
@@ -40,0 +37,0 @@ let isLinked = false; |
@@ -63,8 +63,10 @@ "use strict"; | ||
// serve our index.html after vite history fallback | ||
const indexPath = `/@fs/${path_1.default.join(alias_1.APP_PATH, 'index.html')}`; | ||
return () => { | ||
// @ts-ignore | ||
server.app.use((req, _, next) => { | ||
server.app.use((req, res, next) => { | ||
if (req.url.endsWith('.html')) { | ||
req.url = indexPath; | ||
res.statusCode = 200; | ||
res.end(`<div id="app"></div>\n` + | ||
`<script type="module" src="/@fs/${alias_1.APP_PATH}/index.js"></script>`); | ||
return; | ||
} | ||
@@ -71,0 +73,0 @@ next(); |
{ | ||
"name": "vitepress", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "Vite & Vue powered static site generator", | ||
@@ -5,0 +5,0 @@ "main": "dist/node/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
229668
170
3631