nonzzz / vite-plugin-compression

vite plugin. compress your bundle file.
MIT License
162 stars 9 forks source link

[tarball] robots.txt from public folder is not bundled #51

Closed barrenechea closed 3 months ago

barrenechea commented 3 months ago

Bug report 🐞

Hi! I was just trying to use this component, but I found a small issue for my use case.

Version & Environment

vite-plugin-compression2 "^1.1.0" Node.js v20.13.1, React project

Expection

I'm storing a robots.txt file inside my /public folder. The file gets copied to the /dist folder when I run the build. I expect robots.txt to be bundled on the dist.tar.gz file, even if it's not being compressed.

Actual results (or Errors)

The file is not included in the dist.tar.gz file.

nonzzz commented 3 months ago

Can you share your config or create an minimal reproduction

barrenechea commented 3 months ago

Here it is: https://stackblitz.com/edit/vitejs-vite-21q1mm?file=vite.config.ts

If I only run plugins: [react(), tarball()], the files get properly bundled (it embeds the .txt and .svg).

If I run plugins: [react(), compression(), tarball()], the .txt and .svg files are not bundled within the tarball.

EDIT: Sorry, I think I messed up something with the example, I'll fix it tomorrow with a fresh brain

nonzzz commented 3 months ago

It's really a bug. I forget sync the statics in some case. And currently about tarball is missing a full document.

nonzzz commented 3 months ago

Work at v1.1.1