Revert "fix(build): respect srcExclude in content loader" (#2975)

* Revert "fix(build): respect srcExclude in content loader (#2963)"

This reverts commit 3023b5c76b.

* keep changes in dynamicRoutesPlugin.ts
pull/2977/head
Divyansh Singh 11 months ago committed by GitHub
parent 3023b5c76b
commit 76e9fe86b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -97,7 +97,6 @@ export async function resolveConfig(
const config: SiteConfig = { const config: SiteConfig = {
root, root,
srcDir, srcDir,
srcExclude: userConfig.srcExclude || [],
assetsDir, assetsDir,
site, site,
themeDir, themeDir,

@ -106,8 +106,7 @@ export function createContentLoader<T = ContentData[]>(
// the loader is being called directly, do a fresh glob // the loader is being called directly, do a fresh glob
files = ( files = (
await glob(pattern, { await glob(pattern, {
cwd: config.srcDir, ignore: ['**/node_modules/**', '**/dist/**']
ignore: ['**/node_modules/**', '**/dist/**', ...config.srcExclude]
}) })
).sort() ).sort()
} }

@ -28,6 +28,12 @@ import { webFontsPlugin } from './plugins/webFontsPlugin'
import { slash, type PageDataPayload } from './shared' import { slash, type PageDataPayload } from './shared'
import { deserializeFunctions, serializeFunctions } from './utils/fnSerialize' import { deserializeFunctions, serializeFunctions } from './utils/fnSerialize'
declare module 'vite' {
interface UserConfig {
vitepress?: SiteConfig
}
}
const themeRE = /\/\.vitepress\/theme\/index\.(m|c)?(j|t)s$/ const themeRE = /\/\.vitepress\/theme\/index\.(m|c)?(j|t)s$/
const hashRE = /\.(\w+)\.js$/ const hashRE = /\.(\w+)\.js$/
const staticInjectMarkerRE = const staticInjectMarkerRE =

@ -1,7 +0,0 @@
import 'vite'
declare module 'vite' {
interface UserConfig {
vitepress?: import('./config').SiteConfig
}
}

@ -216,7 +216,6 @@ export interface SiteConfig<ThemeConfig = any>
> { > {
root: string root: string
srcDir: string srcDir: string
srcExclude: string[]
site: SiteData<ThemeConfig> site: SiteData<ThemeConfig>
configPath: string | undefined configPath: string | undefined
configDeps: string[] configDeps: string[]

Loading…
Cancel
Save