Skip to content
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

Inconsistent assetsBuildDirectory path in "build/server/assets/server-build-[hash].js" while nested building in Windows #10149

Open
adelriosantiago opened this issue Oct 22, 2024 · 0 comments

Comments

@adelriosantiago
Copy link

adelriosantiago commented Oct 22, 2024

Reproduction

-Grab a project with a vite.config.js.
-Build in Windows with buildDirectory: 'build/test' then with buildDirectory: 'build\\test'.
-Both builds at "build/server/assets/server-build-[hash].js" will have the same "assetsBuildDirectory" apth which works only in Windows.
-I would expect the "assetsBuildDirectory" to have "/" like all other lines, instead the file includes:

//...
const mode = "pre-prod";
const assetsBuildDirectory = "artifacts\\test\\client";
const basename = "/";
//...

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 7.72 GB / 15.95 GB
  Binaries:
    Node: 20.13.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.5.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.4.0 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Chromium (128.0.2739.79)
    Internet Explorer: 11.0.19041.4355

Used Package Manager

npm

Expected Behavior

I would expect the builder to keep be buildDirectory: 'build/test', which works both in Windows and Linux.

Actual Behavior

The line is buildDirectory: 'build\\test' when built in Windows, and buildDirectory: 'build/test' (correct) in Linux. The latter one works in Windows and Linux.

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

No branches or pull requests

2 participants