Skip to content

Build minisearch indexes after vite.plugins.transform #4979

@s3xysteak

Description

@s3xysteak

As we know, set a title for a markdown can make minisearch build an index for the page, which works well.

When I make a vite plugin to add titles in batches, minisearch cannot correctly make indexes:

defineConfig({
    /* ... */
    vite: {
      plugins: [
        {
          transform: (code, id) => {
            return isMd(id) ? (getTitle(id) + code) : code
          }
        },
      ],
    },
  })

Is that possible to make it work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildRelated to the build system

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions