Skip to content

[Bug]: rsbuild preview fails when you use a custom dist path #7481

@binarykitchen

Description

@binarykitchen

Version

System:
    OS: Linux 6.19 EndeavourOS
    CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
    Memory: 6.78 GB / 15.46 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chromium: 146.0.7680.177
    Firefox: 149.0.2
    Firefox Developer Edition: 149.0.2
  npmPackages:
    @rsbuild/core: 1.7.5 => 1.7.5 
    @rsbuild/plugin-node-polyfill: 1.4.4 => 1.4.4 
    @rsbuild/plugin-pug: 1.3.2 => 1.3.2 
    @rsbuild/plugin-react: 1.4.6 => 1.4.6 
    @rsbuild/plugin-stylus: 1.3.1 => 1.3.1 
    @rsbuild/plugin-svgr: 1.3.1 => 1.3.1

Details

In my rsbuild config I set the distPath config to a different path, ./var. This is breaking the preview command. It cannot find the build because it always defaults to dist.

> videomail.io@3.1.0 preview
> rsbuild preview

Rsbuild v1.7.5

error   Failed to start preview server.
error   [rsbuild:preview] The output directory /home/michael-heuberger/code/binarykitchen/videomail.io/dist does not exist, please build the project before previewing.

Would be good to have it configurable, or make rsbuild preview even smarter, honouring your existing rsbuild config?

Reproduce link

N/A

Reproduce Steps

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions