Run pnpm run build in project root and then in demo/
Error
[vite:compress] setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.
file: /home/hydrocodone/Repositories/vite-plugin-compress/demo/public/test.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 (/home/hydrocodone/Repositories/vite-plugin-compress/node_modules/.pnpm/rollup@2.45.2/node_modules/rollup/dist/shared/rollup.js:5305:30)
at throwPluginError (/home/hydrocodone/Repositories/vite-plugin-compress/node_modules/.pnpm/rollup@2.45.2/node_modules/rollup/dist/shared/rollup.js:18040:12)
at Object.error (/home/hydrocodone/Repositories/vite-plugin-compress/node_modules/.pnpm/rollup@2.45.2/node_modules/rollup/dist/shared/rollup.js:18666:20)
at Object.error (/home/hydrocodone/Repositories/vite-plugin-compress/node_modules/.pnpm/rollup@2.45.2/node_modules/rollup/dist/shared/rollup.js:18209:38)
at Object.setAssetSource (/home/hydrocodone/Repositories/vite-plugin-compress/node_modules/.pnpm/rollup@2.45.2/node_modules/rollup/dist/shared/rollup.js:18228:29)
at Object.transform (/home/hydrocodone/Repositories/vite-plugin-compress/dist/plugin.js:107:34)
at async ModuleLoader.addModuleSource (/home/hydrocodone/Repositories/vite-plugin-compress/node_modules/.pnpm/rollup@2.45.2/node_modules/rollup/dist/shared/rollup.js:18403:30)
at async ModuleLoader.fetchModule (/home/hydrocodone/Repositories/vite-plugin-compress/node_modules/.pnpm/rollup@2.45.2/node_modules/rollup/dist/shared/rollup.js:18459:9)
at async Promise.all (index 1)
at async ModuleLoader.fetchStaticDependencies (/home/hydrocodone/Repositories/vite-plugin-compress/node_modules/.pnpm/rollup@2.45.2/node_modules/rollup/dist/shared/rollup.js:18485:34)
ERROR Command failed with exit code 1.
This could be caused by recent breaking change in Vite v2.3.0. Will submit PR for review.
Steps to reproduce
git clone
into a fresh directorypnpm run build
in project root and then indemo/
Error
This could be caused by recent breaking change in Vite v2.3.0. Will submit PR for review.