Skip to content

Vite V6 - [Environment API] build.assetsDir is not fully respected in the client environment #13430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
CaptinKraken opened this issue Apr 18, 2025 · 1 comment · May be fixed by #13491
Open

Comments

@CaptinKraken
Copy link

I'm using React Router as a...

framework

Reproduction

https://stackblitz.com/edit/github-fnjseyom?file=vite.config.ts

Run npm run build and look at the output

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @react-router/dev: * => 7.5.1 
    @react-router/node: * => 7.5.1 
    @react-router/serve: * => 7.5.1 
    react-router: * => 7.5.1 
    vite: ^6.0.11 => 6.3.2

Used Package Manager

npm

Expected Behavior

I expect the assetsDir to be respected, for all client output files.

Image

Instead, this is only achieved by also specifying the environment.client.build.assetsDir and having it match the build.assetsDir

Actual Behavior

Image
@CaptinKraken
Copy link
Author

CaptinKraken commented Apr 18, 2025

The Vite docs highlight that the top level build config should be inherited, if an environment specific config isn't specified https://vite.dev/guide/api-environment#:~:text=when%20not%20explicitly%20documented%2C%20environment%20inherits%20the%20configured%20top-level%20config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants