UNPKG

next-plugin-preval

Version:

> Pre-evaluate async functions (for data fetches) at build time and import them like JSON

9 lines (6 loc) 200 B
import preval from 'next-plugin-preval'; async function getData() { await new Promise((resolve) => setTimeout(resolve, 100)); return { data: 'hello_world' }; } export default preval(getData());