test: fix dynamic routes test for build

pull/2010/head
Evan You 2 years ago
parent 956de3bfa2
commit 8c9833ceba

@ -1,4 +1,4 @@
// Vitest Snapshot v1 // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`render correct content > main content 1`] = ` exports[`render correct content > main content 1`] = `
[ [

@ -1,4 +1,4 @@
// Vitest Snapshot v1 // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`static data file support in vite 3 > render correct content 1`] = ` exports[`static data file support in vite 3 > render correct content 1`] = `
[ [

@ -57,7 +57,7 @@ export const dynamicRoutesPlugin = async (
resolveId(id) { resolveId(id) {
if (!id.endsWith('.md')) return if (!id.endsWith('.md')) return
const normalizedId = id.startsWith(config.root) const normalizedId = id.startsWith(config.srcDir)
? id ? id
: normalizePath(path.resolve(config.srcDir, id.replace(/^\//, ''))) : normalizePath(path.resolve(config.srcDir, id.replace(/^\//, '')))
const matched = config.dynamicRoutes.routes.find( const matched = config.dynamicRoutes.routes.find(

Loading…
Cancel
Save