Skip to content

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

Open
@adelriosantiago

Description

@adelriosantiago

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions