allow modifying public assets after build (or in hook)
Environment
- Operating System:
Darwin - Node Version:
v16.14.0 - Nuxt Version:
3.0.0-rc.9 - Nitro Version:
0.5.0 - Package Manager:
[email protected] - Builder:
vite - User Config:
app,ssr,postcss,generate,nitro,buildModules,css,meta,modules,sitemap,image,unocss,publicRuntimeConfig,vite,nuxtTypedRouter,plugins - Runtime Modules:
@unocss/[email protected],@nuxt/[email protected],[email protected],@funken-studio/[email protected] - Build Modules:
@pinia/[email protected],@vueuse/[email protected],()
Reproduction
I have purgecss running from CLI after building and app. Like on the top of the build process, after updating it to rc9 purgecss (which clears vuetify styles) generate ERR_CONTENT_LENGTH_MISMATCH error. But I couldn't manage to reproduce it on stackblitz.
- build the app
- use purgecss CLI
purgecss -c purgeCSSConfig.js - serve the app
Describe the bug
Purging css after build by using purgecss breaks fetching CSS. purgecss -c purgeCSSConfig.js
Additional context
No response
Logs
No response
@danielroe Here is a reproduction: https://stackblitz.com/edit/github-w6cj1g-eqr6s9?file=package.json
But on stackblitz everything works, you need to download project locally, then:
- npm I
- npm run build
- npm purge
- npm preview
Im getting ERR_CONTENT_LENGTH_MISMATCH error on every CSS file that was purged, it may be a Mac m1 problem. But on rc6 everything was 100% ok (I think on rc8 also). It might be something with new nitro 0.5.0
When i try to use purgecss "proper way" by using postcss.plygins['@fullhuman/postcss-purgecss'] in nuxt.config.js. Im getting this error: https://github.com/unocss/unocss/issues/1538
I'm getting the same issue on some png files. svg are fine. Perhaps some kind of optimizer is running?
Ahh. The issue is that etags/size/mime/encoding is calculated when the nitro build happens, and you are modifying the files afterwards.
Having the same issue. In nuxt 2 my CMS could add pictures to /static and its still being served. Now it says file not found.