Skip to content

Commit

Permalink
chore: remove redundant check for `MARKDOWN_EXTENSION_REGEX.test(file…
Browse files Browse the repository at this point in the history
…name)` in loader (#608)
  • Loading branch information
dimaMachina committed Jul 28, 2022
1 parent 417918a commit 512953f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-games-nail.md
@@ -0,0 +1,5 @@
---
'nextra': patch
---

chore: remove redundant check for `MARKDOWN_EXTENSION_REGEX.test(filename)` in loader
9 changes: 2 additions & 7 deletions packages/nextra/src/loader.ts
Expand Up @@ -11,11 +11,7 @@ import { parseFileName } from './utils'
import { compileMdx } from './compile'
import { getPageMap, findPagesDir } from './page-map'
import { collectFiles, collectMdx } from './plugin'
import {
MARKDOWN_EXTENSION_REGEX,
IS_PRODUCTION,
DEFAULT_LOCALE
} from './constants'
import { IS_PRODUCTION, DEFAULT_LOCALE } from './constants'

// TODO: create this as a webpack plugin.
const indexContentEmitted = new Set<string>()
Expand Down Expand Up @@ -133,8 +129,7 @@ async function loader(
)

if (unstable_flexsearch) {
// We only add .MD and .MDX contents
if (MARKDOWN_EXTENSION_REGEX.test(filename) && data.searchable !== false) {
if (data.searchable !== false) {
addPage({
fileLocale: fileLocale || DEFAULT_LOCALE,
route,
Expand Down

0 comments on commit 512953f

Please sign in to comment.