-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow
meta.effect
to change value of config
- Loading branch information
Showing
4 changed files
with
60 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Config } from 'vike/types' | ||
|
||
export default { | ||
meta: { | ||
prerenderSetOverEffect: { | ||
env: { config: true }, | ||
global: (value) => typeof value === 'object', | ||
effect({ configValue }) { | ||
return { | ||
prerender: configValue as PrerenderConfig | ||
} | ||
} | ||
} | ||
} | ||
} satisfies Config | ||
|
||
type PrerenderConfig = Config['prerender'] | ||
declare global { | ||
namespace Vike { | ||
interface Config { | ||
prerenderSetOverEffect?: PrerenderConfig | ||
} | ||
} | ||
} | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters