@contentmap/webpack
v1.2.0
Published
webpack and Rspack plugin for contentmap.
Readme
@contentmap/webpack
The webpack and Rspack plugin for contentmap.
For Next.js, use @contentmap/next instead — it handles Turbopack too.
Install
npm i @contentmap/webpackUse
// webpack.config.js
const ContentmapWebpackPlugin = require('@contentmap/webpack')
module.exports = {
plugins: [new ContentmapWebpackPlugin()]
}Content builds before the first compilation and rebuilds in watch mode. Rspack uses the same plugin — the hooks are compatible.
The plugin registers the contentmap/generated alias for you, because webpack does not read tsconfig paths. An alias you set yourself is never overwritten.
import { posts } from 'contentmap/generated'Options
new ContentmapWebpackPlugin({ config: 'contentmap.config.ts' })Every BuilderOptions field is accepted.
Links
MIT
