Skip to content

Add option to configure custom manifest.json path #2

Description

@wicfasho

When running vite build with the current plugin settings, the generated manifest.json ends up under the nested .vite/ directory (publicDir/build/.vite/manifest.json), but the ColdBox helper (Vite.cfc) by default only looks in publicDir/build/manifest.json. While you can work around this in Vite’s config or by overriding buildDirectory in your ColdBox module config, it would be much more ergonomic if the plugin itself exposed an explicit manifestPath (or similar) option so you can tell the helper exactly where to find the manifest.

Reproduction Steps

  1. Install and configure the plugin with defaults.
  2. Run:
    npm run build
  3. Observe that manifest.json is emitted to
    includes/build/.vite/manifest.json
    
  4. In production, ColdBox’s vite() helper throws:
    Manifest file not found. Please run `vite` first.
    
    because it looks for includes/build/manifest.json instead.

Expected Behavior

  • The plugin produces manifest.json in the correct, user‑configurable location.
  • Ideally, the plugin’s API would include something like:
    coldbox({
      input: "src/main.js",
      publicDirectory: "includes",
      buildDirectory: "build",
      manifestPath: ".vite/manifest.json"  // new option
    })
    and the helper would read from that path.

Proposed Solution

  • Add a manifestPath (or manifestDirectory) option to the PluginConfig interface.
  • Pass that through to both the Vite build.manifest setting and write it into the helper’s config.
  • Update Vite.cfc to use that configured path when calling readManifest().

Environment

  • coldbox-vite-plugin version: 3.0.2
  • Node.js: 22.13.1
  • Vite: 6.3.1
  • ColdBox: ColdBox 7.3.1+17 on Lucee 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions