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

[Bug]: writeToDisk don't copy files in public directory to disk #2278

Closed
wood3n opened this issue May 7, 2024 · 6 comments
Closed

[Bug]: writeToDisk don't copy files in public directory to disk #2278

wood3n opened this issue May 7, 2024 · 6 comments
Labels
🐞 bug Something isn't working

Comments

@wood3n
Copy link

wood3n commented May 7, 2024

Version

System:
    OS: Linux 6.1 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (2) x64 AMD EPYC
    Memory: 2.03 GB / 4.01 GB
    Container: Yes
    Shell: Unknown
  npmPackages:
    @rsbuild/core: ^0.6.4 => 0.6.4 
    @rsbuild/plugin-react: ^0.6.4 => 0.6.4

Details

writeToDisk don't copy files in public directory to disk, is this expected?
image

Reproduce link

Edit rspack-contrib/rsbuild-codesandbox-example/csb-mpydj2/draft/optimistic-chatelet

Reproduce Steps

open codesandbox link and run pnpm run dev

@wood3n wood3n added the 🐞 bug Something isn't working label May 7, 2024
@chenjiahan
Copy link
Member

Yes, this is expected, Rsbuild only copy files from the public dir to the dist dir on the production build.

@wood3n
Copy link
Author

wood3n commented May 7, 2024

Could this support in the development environment? Or I can only use output.copy to do this?

@chenjiahan
Copy link
Member

chenjiahan commented May 8, 2024

Yeah you can use output.copy to do this.

@9aoy Should we copy the public dir during development build if writeToDisk is true?

@9aoy
Copy link
Collaborator

9aoy commented May 8, 2024

output.copy and server.publicDir can achieve similar functions, but they are implemented in different ways.

From the perspective of publicDir feature implementation, it is not necessary to write to the disk during development build . I'm a little curious, what circumstances do you need to rely on copying files to disk? @wood3n

@wood3n
Copy link
Author

wood3n commented May 8, 2024

@9aoy 😄 when develop chrome extension, it needs a manifest.json, so I put it in public folder.

@chenjiahan
Copy link
Member

Okay, so it is expected that public dir is not copied during dev build, I will document this.

@wood3n wood3n closed this as completed May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants