-
Notifications
You must be signed in to change notification settings - Fork 13
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
Failed to compress svg's #15
Comments
Fixed in v2.1.1 |
Well, the I haven't investigated the |
I am not even sure if I used glob pattern correctly for |
Same
|
thanks for explanation ! |
hi :) I also have the same error when running a build. However, I do want svg compression. here's the error:
the repo is public: https://github.com/gacallea/anerandros.info/ happy to provide more info and setup if needed :) |
I got this error while trying this plugin. Any idea how to exclude svg's ? I tried :
compress({ exclude: ["*.svg"] })
✓ 560 modules transformed.
[vite:compress] setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.
file: F:/GitHub/senf/apps/senf-client/src/images/svgIcons/plus.svg
error during build:
Error: setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook. at error (F:\GitHub\senf\apps\senf-client\node_modules\rollup\dist\shared\rollup.js:198:30)
at throwPluginError (F:\GitHub\senf\apps\senf-client\node_modules\rollup\dist\shared\rollup.js:21847:12)
at Object.error (F:\GitHub\senf\apps\senf-client\node_modules\rollup\dist\shared\rollup.js:22570:20)
at Object.error (F:\GitHub\senf\apps\senf-client\node_modules\rollup\dist\shared\rollup.js:22024:42)
at Object.setAssetSource (F:\GitHub\senf\apps\senf-client\node_modules\rollup\dist\shared\rollup.js:22043:33)
at Object.transform (F:\GitHub\senf\apps\senf-client\node_modules\vite-plugin-compress\dist\plugin.js:107:34)
at async transform (F:\GitHub\senf\apps\senf-client\node_modules\rollup\dist\shared\rollup.js:21994:16)
at async ModuleLoader.addModuleSource (F:\GitHub\senf\apps\senf-client\node_modules\rollup\dist\shared\rollup.js:22220:30)
source code looks like this:
import Plus from "../../../images/svgIcons/plus.svg";
<img src={Plus} width="25" alt="AddIcon" />
The text was updated successfully, but these errors were encountered: