nonzzz / vite-plugin-compression

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

need some help after compression success #42

Closed morphiezy closed 10 months ago

morphiezy commented 10 months ago

Can someone guide me how to allow gz or br files to be loaded on a website? I have created a frontend project and I want to deploy it using Netlify. But there is a failure, files compressed using br cannot be loaded. What should i do ?

Screenshot 2023-10-30 120122 image

image

nonzzz commented 10 months ago

You can take a look at Gzip file serving. Like Github Pages or Netlify or Vercel will compress your chunk automatically. May be you won't need this plugin(Or remove option deleteOriginalAssets) . Or if you want to publish your website in other platform. Like amazon S3.( you can set filename: '[path][base]'

morphiezy commented 10 months ago

The first probem is solved, netlify can send response br file. But why the js file cannot be executed and render my component ? the preview of the file also blank. Do u have idea ? @nonzzz

image image

nonzzz commented 10 months ago

any log?

morphiezy commented 10 months ago

image

now it's solved , thank for ur time @nonzzz