@document0/next-dev
v0.7.0
Published
Next.js-specific document0 integration (dev and build tooling)
Readme
@document0/next-dev
Next.js integration for document0: content changes invalidate the server bundle in development (same idea as Fumadocs putting docs on the webpack graph), so DocsSource re-runs without a sidecar or refresh API.
Requirements
next devwith webpack (default for many apps). Custom webpack config is not applied when usingnext dev --turbo— usenext devornext dev --webpack.
Setup
Install
pnpm add @document0/next-devWrap
next.config.tsimport type { NextConfig } from "next"; import { withDocument0 } from "@document0/next-dev"; const nextConfig: NextConfig = { /* ... */ }; export default withDocument0({ contentDir: "content/docs" })(nextConfig);contentDiris relative to the Next project root and defaults tocontent/docs.Import the content stamp once next to your
DocsSource(typicallylib/source.ts)import "@document0/next-dev/content-stamp";Place it in the same module that constructs
new DocsSource(...)so webpack can invalidate that module when files undercontentDirchange.
Production builds do not use the loader; the stamp stays a harmless constant.
