@dbosoft/nextjs-plugin
v1.3.1
Published
Core plugin for dbosoft next.js websites
Keywords
Readme
@dbosoft/nextjs-plugin
A Next.js plugin that auto-discovers and transpiles @dbosoft packages and provides SVG component support. Required for all dbosoft Next.js sites.
Usage
// next.config.mjs
import withDbosoftPlugin from '@dbosoft/nextjs-plugin'
/** @type {import('next').NextConfig} */
const nextConfig = {}
export default withDbosoftPlugin({})(nextConfig)Options
withDbosoftPlugin({
transpileModules: ['some-third-party-package'],
})All options are optional.
| Option | Description |
|--------|-------------|
| transpileModules | Additional package names to add to transpilePackages |
What it does
Auto-discovers
@dbosoftpackages — Scansnode_modules/@dbosoftand adds all found packages to Next.jstranspilePackages. This allows packages that export raw.tsxsource to be compiled by Next.js/Turbopack.SVG component support — Enables importing
.svgfiles as React components.Security headers — Adds
X-Frame-Options: SAMEORIGINto all routes.
Important: pnpm and transitive dependencies
With pnpm, transitive @dbosoft dependencies are not hoisted to node_modules/@dbosoft. The plugin can only discover packages that are direct dependencies of your app. If a @dbosoft package is only a transitive dependency, add it explicitly to your package.json.
