Skip to content

Start: vite config build.assetsDir does not work with nitro config publicAssets #5754

@KevinLu

Description

@KevinLu

Which project does this relate to?

Start

Describe the bug

When using @tanstack/nitro-v2-vite-plugin to configure the publicAssets option in Nitro v2, the build output folder specified by the Vite config option build.assetsDir does not get copied into the .output/public folder.

This results in missing chunks for the production build and thus breaking the build.

Your Example Website or App

https://stackblitz.com/edit/github-egpnw7wu?file=vite.config.js

Steps to Reproduce the Bug or Issue

  1. Specify the build.assetsDir option in vite.config.ts
  2. Use the Nitro plugin
  3. Specify the publicAssets option in the Nitro plugin config in vite.config.ts

Expected behavior

.output/public should contain chunks from the specified build.assetsDir folder but it doesn't.

Screenshots or Videos

After running build (with build.assetsDir set and publicAssets set):

Image
  • you can see there is no custom folder

After running build (with build.assetsDir set and publicAssets NOT set):

Image
  • you can see there is the custom folder

Platform

  • Router / Start Version: 1.134.12
  • OS: macOS
  • Browser: Chrome
  • Browser Version: 141
  • Bundler: vite
  • Bundler Version: 7.1.7

Additional context

No response

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