Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: @unhead/bundler and /vite subpath exports#726

Merged
harlan-zw merged 3 commits into
mainfrom
worktree-unified-vite-plugin
Apr 7, 2026
Merged

feat: @unhead/bundler and /vite subpath exports#726
harlan-zw merged 3 commits into
mainfrom
worktree-unified-vite-plugin

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

❓ Type of change

  • πŸ“– Documentation
  • 🐞 Bug fix
  • πŸ‘Œ Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

πŸ“š Description

Adds a unified ./vite export to each framework package so users get build optimizations + streaming SSR from a single plugin call instead of manually composing multiple plugins.

// before
import Unhead from '@unhead/addons/vite'
import { unheadVuePlugin } from '@unhead/vue/stream/vite'
plugins: [vue(), Unhead(), unheadVuePlugin()]

// after
import unhead from '@unhead/vue/vite'
plugins: [vue(), unhead()]

Also renames @unhead/addons to @unhead/bundler (deprecated alias provided).

⚠️ Breaking Changes

  • @unhead/addons renamed to @unhead/bundler. The old package name still works with a deprecation warning via packages-aliased/addons.
  • Streaming is now opt-in via streaming: true (was previously a separate plugin import).

Changes

  • Unified Vite plugin: @unhead/vue/vite, @unhead/react/vite, @unhead/svelte/vite, @unhead/solid-js/vite
  • Consistent config: all plugin options accept false to disable (treeshake: false, transformSeoMeta: false, minify: false, streaming: false)
  • Rolldown compat: moduleType: 'js' on load hooks, hook filter objects on resolveId/load/transform for reduced Rust↔JS overhead
  • Cleanup: removed stale Vite 4 compat, deprecated treeshake.enabled in favor of treeshake: false

πŸ“ Migration

- import Unhead from '@unhead/addons/vite'
+ import unhead from '@unhead/vue/vite'  // or @unhead/react/vite, etc.

  export default defineConfig({
-   plugins: [vue(), Unhead()]
+   plugins: [vue(), unhead()]
  })

For streaming SSR:

plugins: [vue(), unhead({ streaming: true })]

Summary by CodeRabbit

  • New Features

    • Unified Vite plugin across frameworks with an explicit streaming option and new Vite entrypoints for React, Vue, Solid, Svelte, and SvelteKit examples.
  • Chores

    • Moved integrations to a new bundler package with backward-compatible deprecation shims.
    • Added ability to disable individual build-time transforms via explicit false options.
  • Documentation

    • Replaced SSR tree-shaking guidance with Vite-plugin guidance and updated examples.
  • Tests

    • Updated export/bench/test mappings and example configs to reference the new bundler integration.

…head/bundler

Adds `./vite` export to each framework package (@unhead/vue, @unhead/react,
@unhead/svelte, @unhead/solid-js) that composes build optimizations and
streaming SSR into a single plugin call.

Before:
  import Unhead from '@unhead/addons/vite'
  import { unheadVuePlugin } from '@unhead/vue/stream/vite'
  plugins: [vue(), Unhead(), unheadVuePlugin()]

After:
  import unhead from '@unhead/vue/vite'
  plugins: [vue(), unhead()]

Other changes:
- Rename @unhead/addons to @unhead/bundler
- Deprecated @unhead/addons alias in packages-aliased/
- Normalize plugin options: all accept `false` to disable
- Streaming is opt-in (`streaming: true`)
- Deprecate `treeshake.enabled` in favor of `treeshake: false`
- Add `moduleType: 'js'` to streaming load hooks for Rolldown compat
- Use hook filter objects on resolveId/load for Rolldown performance
- Remove stale Vite 4 compat code
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown
πŸ“ Walkthrough

Walkthrough

Replaces @unhead/addons with @unhead/bundler, adds a deprecated compatibility shim re-exporting from bundler, introduces unified framework ./vite Vite-plugin entrypoints with optional streaming, makes unplugin transforms disableable via false, and updates docs, examples, tests, build configs, and TS/Vitest aliases accordingly.

Changes

Cohort / File(s) Summary
Core bundler package
packages/bundler/package.json, packages/bundler/README.md, packages/bundler/src/unplugin/MinifyTransform.ts
Renamed/repurposed package to @unhead/bundler; README and comment references updated to bundler paths.
Deprecated addons compatibility
packages-aliased/addons/package.json, packages-aliased/addons/build.config.ts, packages-aliased/addons/src/index.ts, .../vite.ts, .../webpack.ts
Added @unhead/addons shim that emits deprecation warnings and re-exports @unhead/bundler (vite/webpack passthroughs).
Unplugin option & registration
packages/bundler/src/unplugin/types.ts, .../vite.ts, .../webpack.ts, .../TreeshakeServerComposables.ts
Unplugin options now accept false to disable transforms; treeshake/SEO plugins registered conditionally; enabled documented deprecated.
Framework Vite entrypoints
packages/react/src/vite.ts, packages/solid-js/src/vite.ts, packages/svelte/src/vite.ts, packages/vue/src/vite.ts
Added ./vite exports: unhead(options?) factories that combine build plugins and optionally append a streaming plugin when streaming is enabled.
Framework builds & package exports
packages/*/build.config.ts, packages/*/package.json (react, solid-js, svelte, vue)
Added src/vite build entries, new ./vite export subpaths, added @unhead/bundler dependency or externals where appropriate.
Examples, benches, tests & configs
examples/**/vite.config.*, bench/*.bench.ts, bench/*.test.ts, bench/vitest.config.ts, packages/vue/vitest.config.ts, tsconfig.json, package.json
Updated example Vite configs to use @unhead/<framework>/vite with { streaming } option; replaced aliases/resolutions from @unhead/addons β†’ @unhead/bundler; updated bench/test imports.
Stream plugin internals
packages/unhead/src/stream/vite.ts
Refactored virtual module resolution/load to object-based API with regex filters and explicit { code, moduleType: 'js' } returns.
Docs & guides
docs/**, docs/head/1.guides/2.advanced/9.vite-plugin.md, various docs/**/0.installation.md
Rewrote Vite/plugin docs and framework guides to recommend framework-specific @unhead/{framework}/vite and updated references from @unhead/addons β†’ @unhead/bundler.
Export assertions & tests
test/exports/*.yaml, test/exports/bundler.yaml, packages/vue/test/bench/*.ts
Added/updated YAML export assertions for new ./vite and bundler exports; added test/exports/bundler.yaml; updated tests/benches to import from bundler.

Sequence Diagram(s)

sequenceDiagram
    participant App as Framework App
    participant UnheadVite as unhead() Vite Factory
    participant Bundler as `@unhead/bundler` (buildPlugins)
    participant StreamPlugin as Streaming Plugin
    participant Vite as Vite (final plugins)

    App->>UnheadVite: unhead({ streaming: true })
    UnheadVite->>Bundler: buildPlugins(options)
    Bundler-->>UnheadVite: [Treeshake, SEO, Minify...]
    UnheadVite->>StreamPlugin: create streaming plugin (mode?)
    StreamPlugin-->>UnheadVite: streaming plugin
    UnheadVite->>Vite: return Plugin[]
Loading
sequenceDiagram
    participant Consumer as Consumer Code
    participant AddonsShim as `@unhead/addons` shim
    participant BundlerPkg as `@unhead/bundler`
    participant Console as Console

    Consumer->>AddonsShim: import { InferSeoMetaPlugin }
    AddonsShim->>Console: console.warn("deprecated, use `@unhead/bundler`")
    AddonsShim->>BundlerPkg: re-export requested symbol
    BundlerPkg-->>AddonsShim: implementation
    AddonsShim-->>Consumer: provide InferSeoMetaPlugin
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 Once addons hopped, now bundler’s the trail,
Warnings soft-thump: β€œplease migrate the sail.”
Vite plugins gather, streaming joins the dance,
Exports rerouted β€” a forward-bound prance,
Hoppy builds, tidy paths β€” a developer’s waltz!

πŸš₯ Pre-merge checks | βœ… 3
βœ… Passed checks (3 passed)
Check name Status Explanation
Description check βœ… Passed The description follows the template structure with type of change checkboxes, detailed description with code examples, explicit breaking changes section, and migration guide.
Docstring Coverage βœ… Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
Title check βœ… Passed The title accurately summarizes the main changes: introducing @unhead/bundler package and new /vite subpath exports for framework packages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-unified-vite-plugin

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Bundle Size Gzipped
Client (Minimal) 10.6 kB 4.3 kB
Server (Minimal) 10.3 kB 4.2 kB
Vue Client (Minimal) 11.6 kB 4.8 kB
Vue Server (Minimal) 11.3 kB 4.6 kB

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/head/1.guides/2.advanced/9.vite-plugin.md (1)

23-29: ⚠️ Potential issue | 🟑 Minor

Update stale β€œaddons package” wording.

Line 23 still says β€œaddons package” after the rename to @unhead/bundler, which is confusing in migration docs.

πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/head/1.guides/2.advanced/9.vite-plugin.md` around lines 23 - 29, The
docs still refer to the "addons package" which is stale; update the wording
around the install snippet to refer to the renamed package `@unhead/bundler`
(e.g., "install the `@unhead/bundler` package that contains the build plugins")
and ensure the explanatory sentence that precedes the pnpm add -D
`@unhead/bundler` command uses "@unhead/bundler" (or "bundler package") instead of
"addons package" so the text matches the code sample.
🧹 Nitpick comments (3)
packages-aliased/addons/src/webpack.ts (1)

1-4: Deprecation warning may flood build logs.

The console.warn executes unconditionally at module load time, which could produce repeated warnings in build environments where the module is imported multiple times across different files.

Consider guarding the warning to only emit once:

πŸ’‘ Suggested improvement to emit warning only once
+let warned = false
+if (!warned) {
+  warned = true
   console.warn('[unhead] `@unhead/addons/webpack` is deprecated. Please migrate to `@unhead/bundler/webpack` instead.')
+}

 export { default } from '@unhead/bundler/webpack'
 export * from '@unhead/bundler/webpack'

Alternatively, this may be acceptable if the intent is to be noisy about the deprecation during the migration period.

πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages-aliased/addons/src/webpack.ts` around lines 1 - 4, The unconditional
console.warn at module load will spam logs when the package is imported multiple
times; change it to emit only once by checking/storing a module-global sentinel
(e.g., a symbol or boolean on globalThis) before calling console.warn so
subsequent imports skip the message; update the top-level console.warn
invocation in this file (the deprecation message and the export statements
referencing '@unhead/bundler/webpack') to first check the sentinel and set it
after emitting the warning.
packages-aliased/addons/build.config.ts (1)

3-10: Consider adding externals for @unhead/bundler.

Since this package only re-exports from @unhead/bundler, consider adding externals to ensure the bundler package isn't accidentally inlined:

πŸ’‘ Suggested improvement
 export default defineBuildConfig({
   clean: true,
   declaration: true,
+  externals: ['@unhead/bundler', '@unhead/bundler/vite', '@unhead/bundler/webpack'],
   entries: [
     { input: 'src/index', name: 'index' },
     { input: 'src/vite', name: 'vite' },
     { input: 'src/webpack', name: 'webpack' },
   ],
 })
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages-aliased/addons/build.config.ts` around lines 3 - 10, The build
config currently bundles all imports for the entries defined in
defineBuildConfig (entries: [{ input: 'src/index' ... }]), which can inline
re-exports from `@unhead/bundler`; add an externals setting to the
defineBuildConfig call to mark "@unhead/bundler" as external (e.g., externals:
['@unhead/bundler'] or the equivalent rollup/tsup externals option) so the
package is not inlined into the addon outputβ€”update the build config where
defineBuildConfig is invoked to include this externals array.
packages-aliased/addons/package.json (1)

40-48: Consider adding .d.ts extension to typesVersions paths for clarity.

The typesVersions entries (dist/vite, dist/webpack) omit the .d.ts extension. While TypeScript can resolve these correctly in most cases, being explicit with dist/vite.d.ts and dist/webpack.d.ts would match the explicit pattern used in the exports field and improve consistency.

Proposed fix
   "typesVersions": {
     "*": {
       "vite": [
-        "dist/vite"
+        "dist/vite.d.ts"
       ],
       "webpack": [
-        "dist/webpack"
+        "dist/webpack.d.ts"
       ]
     }
   },
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages-aliased/addons/package.json` around lines 40 - 48, The typesVersions
entries currently point to "dist/vite" and "dist/webpack" without file
extensions; update the typesVersions mapping so the "vite" and "webpack" target
arrays reference the explicit declaration files (e.g., "dist/vite.d.ts" and
"dist/webpack.d.ts") to match the explicit pattern used in exports and improve
consistency; locate the typesVersions block and replace the paths for the "vite"
and "webpack" keys accordingly.
πŸ€– Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/0.react/schema-org/guides/get-started/0.installation.md`:
- Line 75: The import currently uses the bundler package; change the import
source from '@unhead/bundler/vite' to the unified React Vite plugin
'@unhead/react/vite' for the existing import declaration (the line that defines
import UnheadVite). Ensure the identifier (UnheadVite) continues to be used
unchanged elsewhere in the document after updating the import so references like
UnheadVite remain valid.

In `@docs/head/1.guides/2.advanced/9.vite-plugin.md`:
- Line 63: The example incorrectly uses a named import "UnheadWebpack" from
"@unhead/bundler/webpack" even though that package only provides a default
export; update the import statement to use a default import for UnheadWebpack
(replace the named import form with a default import of UnheadWebpack from
"@unhead/bundler/webpack") so the module resolves at runtime.

---

Outside diff comments:
In `@docs/head/1.guides/2.advanced/9.vite-plugin.md`:
- Around line 23-29: The docs still refer to the "addons package" which is
stale; update the wording around the install snippet to refer to the renamed
package `@unhead/bundler` (e.g., "install the `@unhead/bundler` package that
contains the build plugins") and ensure the explanatory sentence that precedes
the pnpm add -D `@unhead/bundler` command uses "@unhead/bundler" (or "bundler
package") instead of "addons package" so the text matches the code sample.

---

Nitpick comments:
In `@packages-aliased/addons/build.config.ts`:
- Around line 3-10: The build config currently bundles all imports for the
entries defined in defineBuildConfig (entries: [{ input: 'src/index' ... }]),
which can inline re-exports from `@unhead/bundler`; add an externals setting to
the defineBuildConfig call to mark "@unhead/bundler" as external (e.g.,
externals: ['@unhead/bundler'] or the equivalent rollup/tsup externals option)
so the package is not inlined into the addon outputβ€”update the build config
where defineBuildConfig is invoked to include this externals array.

In `@packages-aliased/addons/package.json`:
- Around line 40-48: The typesVersions entries currently point to "dist/vite"
and "dist/webpack" without file extensions; update the typesVersions mapping so
the "vite" and "webpack" target arrays reference the explicit declaration files
(e.g., "dist/vite.d.ts" and "dist/webpack.d.ts") to match the explicit pattern
used in exports and improve consistency; locate the typesVersions block and
replace the paths for the "vite" and "webpack" keys accordingly.

In `@packages-aliased/addons/src/webpack.ts`:
- Around line 1-4: The unconditional console.warn at module load will spam logs
when the package is imported multiple times; change it to emit only once by
checking/storing a module-global sentinel (e.g., a symbol or boolean on
globalThis) before calling console.warn so subsequent imports skip the message;
update the top-level console.warn invocation in this file (the deprecation
message and the export statements referencing '@unhead/bundler/webpack') to
first check the sentinel and set it after emitting the warning.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 03d237af-ca78-4146-af6b-163eb09992d4

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 093a277 and e61395c.

β›” Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
πŸ“’ Files selected for processing (67)
  • bench/ssr-harlanzw-com-e2e.bench.ts
  • bench/ssr-harlanzw-com-e2e.test.ts
  • bench/ssr-harlanzw-no-schema-e2e.bench.ts
  • bench/vitest.config.ts
  • docs/0.angular/schema-org/guides/get-started/0.installation.md
  • docs/0.react/schema-org/guides/get-started/0.installation.md
  • docs/0.solid-js/schema-org/guides/get-started/0.installation.md
  • docs/0.svelte/schema-org/guides/get-started/0.installation.md
  • docs/0.typescript/schema-org/guides/get-started/0.installation.md
  • docs/0.vue/schema-org/guides/0.get-started/0.installation.md
  • docs/head/1.guides/2.advanced/9.vite-plugin.md
  • docs/head/1.guides/plugins/minify.md
  • examples/vite-ssr-react-streaming/vite.config.ts
  • examples/vite-ssr-react-ts/vite.config.ts
  • examples/vite-ssr-solidjs-streaming/vite.config.ts
  • examples/vite-ssr-svelte-streaming/vite.config.ts
  • examples/vite-ssr-vue-prerender/vite.config.js
  • examples/vite-ssr-vue-streaming/vite.config.ts
  • package.json
  • packages-aliased/addons/build.config.ts
  • packages-aliased/addons/package.json
  • packages-aliased/addons/src/index.ts
  • packages-aliased/addons/src/vite.ts
  • packages-aliased/addons/src/webpack.ts
  • packages/bundler/.attw.json
  • packages/bundler/README.md
  • packages/bundler/build.config.ts
  • packages/bundler/package.json
  • packages/bundler/src/constants.ts
  • packages/bundler/src/index.ts
  • packages/bundler/src/minify/esbuild.ts
  • packages/bundler/src/minify/lightningcss.ts
  • packages/bundler/src/minify/rolldown.ts
  • packages/bundler/src/unplugin/MinifyTransform.ts
  • packages/bundler/src/unplugin/TreeshakeServerComposables.ts
  • packages/bundler/src/unplugin/UseSeoMetaTransform.ts
  • packages/bundler/src/unplugin/types.ts
  • packages/bundler/src/unplugin/vite.ts
  • packages/bundler/src/unplugin/webpack.ts
  • packages/bundler/test/minify.test.ts
  • packages/bundler/test/minifyTransform.test.ts
  • packages/bundler/test/treeshakeServerComposables.test.ts
  • packages/bundler/test/useSeoMetaTransform.test.ts
  • packages/bundler/tsconfig.json
  • packages/bundler/vite.d.ts
  • packages/bundler/webpack.d.ts
  • packages/react/build.config.ts
  • packages/react/package.json
  • packages/react/src/vite.ts
  • packages/solid-js/build.config.ts
  • packages/solid-js/package.json
  • packages/solid-js/src/vite.ts
  • packages/svelte/build.config.ts
  • packages/svelte/package.json
  • packages/svelte/src/vite.ts
  • packages/unhead/src/stream/vite.ts
  • packages/vue/build.config.ts
  • packages/vue/package.json
  • packages/vue/src/vite.ts
  • packages/vue/test/bench/ssr-harlanzw-no-schema-e2e.bench.ts
  • packages/vue/vitest.config.ts
  • test/exports/bundler.yaml
  • test/exports/react.yaml
  • test/exports/solid-js.yaml
  • test/exports/svelte.yaml
  • test/exports/vue.yaml
  • tsconfig.json


```ts [@unhead/schema-org]
import UnheadVite from '@unhead/addons/vite'
import UnheadVite from '@unhead/bundler/vite'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify package export maps include ./vite
rg -n '"\./vite"' packages/react/package.json packages/bundler/package.json

# Verify React vite entrypoint file exists
fd -i "vite.ts" packages/react/src

Repository: unjs/unhead

Length of output: 211


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check the documentation file at the specified location
cat -n docs/0.react/schema-org/guides/get-started/0.installation.md | head -100

Repository: unjs/unhead

Length of output: 3081


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check react package.json exports
echo "=== React package.json exports ==="
rg -A 5 '"./vite"' packages/react/package.json

echo ""
echo "=== Bundler package.json exports ==="
rg -A 5 '"./vite"' packages/bundler/package.json

Repository: unjs/unhead

Length of output: 435


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== React vite.ts ==="
cat -n packages/react/src/vite.ts

echo ""
echo "=== Finding bundler vite.ts ==="
fd "vite.ts" packages/bundler/src

echo ""
echo "=== Bundler vite.ts (if exists) ==="
if [ -f "packages/bundler/src/vite.ts" ]; then
  cat -n packages/bundler/src/vite.ts
fi

Repository: unjs/unhead

Length of output: 1715


Update import to use the unified React Vite plugin.

Line 75 should use @unhead/react/vite instead of @unhead/bundler/vite. This aligns the React guide with the unified Vite plugin designed for React apps, which combines build optimizations and streaming SSR support into a single plugin.

Proposed doc snippet update
-import UnheadVite from '@unhead/bundler/vite'
+import unhead from '@unhead/react/vite'
 import { defineConfig } from 'vite'

 export default defineConfig({
   plugins: [
-    UnheadVite(),
+    unhead(),
   ]
 })
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/0.react/schema-org/guides/get-started/0.installation.md` at line 75, The
import currently uses the bundler package; change the import source from
'@unhead/bundler/vite' to the unified React Vite plugin '@unhead/react/vite' for
the existing import declaration (the line that defines import UnheadVite).
Ensure the identifier (UnheadVite) continues to be used unchanged elsewhere in
the document after updating the import so references like UnheadVite remain
valid.


```ts
import { UnheadWebpack } from '@unhead/addons/webpack'
import { UnheadWebpack } from '@unhead/bundler/webpack'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== package exports =="
sed -n '1,140p' packages/bundler/package.json

echo
echo "== webpack-related source files =="
fd -i 'webpack.ts' packages/bundler/src --exec sh -c 'echo "--- {}"; sed -n "1,180p" "{}"'

Repository: unjs/unhead

Length of output: 3893


Change import to default export.

The docs example uses a named import, but @unhead/bundler/webpack only exports a default export. This will fail at runtime.

Apply this fix
-import { UnheadWebpack } from '@unhead/bundler/webpack'
+import UnheadWebpack from '@unhead/bundler/webpack'
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/head/1.guides/2.advanced/9.vite-plugin.md` at line 63, The example
incorrectly uses a named import "UnheadWebpack" from "@unhead/bundler/webpack"
even though that package only provides a default export; update the import
statement to use a default import for UnheadWebpack (replace the named import
form with a default import of UnheadWebpack from "@unhead/bundler/webpack") so
the module resolves at runtime.

Replace duplicated tree-shaking snippets in schema-org install docs with
framework-specific examples using the new unified plugin. Rewrite the main
Vite Plugin guide as the canonical reference for all frameworks. Update
minify docs to reference the unified plugin.
Focus on the primary benefits (tree-shaking server code, transforming
head composables) rather than the niche schema-org stripping.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docs/0.vue/schema-org/guides/0.get-started/0.installation.md (1)

76-83: Consider adding the defineConfig import for completeness.

The code example uses defineConfig but doesn't show its import. While experienced developers will know this comes from 'vite', adding the import would make the example more self-contained and easier to copy-paste.

πŸ“ Suggested addition for a complete example
 ```ts
+import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 import unhead from '@unhead/vue/vite'

 export default defineConfig({
   plugins: [vue(), unhead()],
 })
</details>

<details>
<summary>πŸ€– Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/0.vue/schema-org/guides/0.get-started/0.installation.md around lines 76

  • 83, Add the missing import for defineConfig so the example is self-contained:
    import defineConfig from 'vite' (i.e., include "import { defineConfig } from
    'vite'") at the top of the snippet before using defineConfig in the export; this
    ensures the referenced symbol defineConfig is defined while keeping the existing
    vue() and unhead() plugin usages unchanged.

</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>πŸ€– Prompt for all review comments with AI agents</summary>

Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @docs/0.vue/schema-org/guides/0.get-started/0.installation.md:

  • Around line 76-83: Add the missing import for defineConfig so the example is
    self-contained: import defineConfig from 'vite' (i.e., include "import {
    defineConfig } from 'vite'") at the top of the snippet before using defineConfig
    in the export; this ensures the referenced symbol defineConfig is defined while
    keeping the existing vue() and unhead() plugin usages unchanged.

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>βš™οΈ Run configuration</summary>

**Configuration used**: defaults

**Review profile**: CHILL

**Plan**: Pro

**Run ID**: `df022062-2d07-425c-b3d1-21db1f6c3b22`

</details>

<details>
<summary>πŸ“₯ Commits</summary>

Reviewing files that changed from the base of the PR and between 2faa69b76fdc43e5606daaf17fe86785d6d1c8eb and bbc9d708b79c947527a8a6112f7be33748850b9e.

</details>

<details>
<summary>πŸ“’ Files selected for processing (6)</summary>

* `docs/0.angular/schema-org/guides/get-started/0.installation.md`
* `docs/0.react/schema-org/guides/get-started/0.installation.md`
* `docs/0.solid-js/schema-org/guides/get-started/0.installation.md`
* `docs/0.svelte/schema-org/guides/get-started/0.installation.md`
* `docs/0.typescript/schema-org/guides/get-started/0.installation.md`
* `docs/0.vue/schema-org/guides/0.get-started/0.installation.md`

</details>

<details>
<summary>βœ… Files skipped from review due to trivial changes (2)</summary>

* docs/0.react/schema-org/guides/get-started/0.installation.md
* docs/0.angular/schema-org/guides/get-started/0.installation.md

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (3)</summary>

* docs/0.typescript/schema-org/guides/get-started/0.installation.md
* docs/0.solid-js/schema-org/guides/get-started/0.installation.md
* docs/0.svelte/schema-org/guides/get-started/0.installation.md

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@harlan-zw harlan-zw changed the title feat: unified vite plugin per framework, rename @unhead/addons to @unhead/bundler feat: @unhead/bundler and /vite subpath exports Apr 7, 2026
@harlan-zw harlan-zw merged commit df9c846 into main Apr 7, 2026
6 checks passed
@harlan-zw harlan-zw mentioned this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant