Skip to content

Commit

Permalink
buildDir is now required
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugos68 committed Jan 28, 2024
1 parent 9f91f77 commit cf9d8a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/red-dragons-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-plugin-pagefind": patch
---

Forced buildDir to be present
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ _Default_: -

### buildDir

Optionally provide a directory where you want pagefind to run after your app has been build.
Provide a directory where you want pagefind to run after your app has been build.

Example: `buildDir: 'public'` results in: `public/pagefind/pagefind.js`

_Default_: "build"
_Default_: -

### cwd

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function log(input: string) {

export type PagefindConfig = {
appDir: string;
buildDir?: string;
buildDir: string;
cwd?: string;
};

Expand Down Expand Up @@ -66,7 +66,7 @@ function pagefindBuild({ buildDir, cwd }: PagefindBuildConfig): PluginOption {

export function pagefind({
appDir,
buildDir = 'build',
buildDir,
cwd = process.cwd()
}: PagefindConfig): PluginOption {
appDir = join(cwd, appDir, 'pagefind');
Expand Down

0 comments on commit cf9d8a7

Please sign in to comment.