@contentmap/next
v1.2.0
Published
Next.js integration for contentmap. Works on Turbopack and webpack.
Readme
@contentmap/next
The Next.js integration for contentmap. Works on both Turbopack and webpack.
Install
npm i @contentmap/nextUse
// next.config.ts
import { withContentmap } from '@contentmap/next'
export default withContentmap({
// your Next config
})Content builds before the first compile and watches in next dev.
Turbopack
Turbopack has no plugin API, so withContentmap builds content before Next starts rather than from inside the bundler. The practical difference is none: output lands on disk either way, and next dev watches it.
Add the path alias to your tsconfig.json so imports resolve — contentmap init does this for you:
{
"compilerOptions": {
"paths": { "contentmap/generated": ["./.contentmap"] }
}
}import { posts } from 'contentmap/generated'Options
Every BuilderOptions field is accepted alongside your Next config.
Links
MIT
