Vendor code-splitting

Apps that embed large libraries (xyflow, yjs, etc.) alongside BarefootJS components can reach 700–800 KB of client JS on first visit. Splitting those libraries out as separate browser chunks dramatically cuts repeat-visit transfer.

BarefootJS has no config of its own for this — vendor code-splitting is Vite's job. Use stock Vite/Rollup config alongside the barefoot() plugin:

// vite.config.ts
import { defineConfig } from 'vite'
import { barefoot } from '@barefootjs/vite'

export default defineConfig({
  plugins: [barefoot({ /* ... */ })],
  build: {
    rollupOptions: {
      output: {
        // Split heavy vendor libraries into their own cacheable chunk.
        manualChunks: {
          xyflow: ['@barefootjs/xyflow'],
          yjs: ['yjs'],
        },
      },
    },
  },
})

Vite's dev server and production build both content-hash and cache these chunks automatically — no manifest to wire up by hand, and no --external flags to compute for a separate bundler pass. See Vite's own code-splitting docs for manualChunks, dynamic import(), and build.rollupOptions.output.