Closed gutierrez-cesar closed 2 years ago
This issue has been labeled as a bug since it was created using the 🚨 Bug Report Template.
Hi there, thank you so much for the report!
Following our Maintenance Process, we will review your bug report and get back to you next Wednesday. To ensure a smooth review of your issue and avoid unnecessary delays, please make sure your issue includes the following:
package.json
file.If you have identified the cause of the bug described in your report and know how to fix it, you're more than welcome to open a pull request address it. Check out our quick start guide for a simple contribution process.
If you think your issue is a question (not a bug) and would like quicker support, please close this issue and forward it to an appropriate section on our community forum: https://community.prismic.io
- The Prismic Open-Source Team
Thanks for the bug report, @gutierrez-cesar. The <PrismicNextImage>
component was introduced in v0.1.3
which is why you are only seeing the added code after upgrading.
If you aren't using the component, it is supposed to be tree-shaken and excluded from the bundle. It likely is not being removed currently because the package does not mark itself as "side-effect free."
I will investigate. 🙂
Hi @gutierrez-cesar, this should be fixed in v0.1.4
.
The package needed to be built in a different way where it no longer bundles everything into one file. Since this package will always be used in Next.js, we can rely on Next.js to bundle. This lets Next.js's bundler omit code that is not used.
More details are available here: #36
You can update to the latest version with the following command:
npm install @prismicio/next@latest
If you are still noticing next/image
in your builds, you may need to delete Next.js's build cache. You can clear it by deleting the .next
directory that is created after building.
Thanks for the report! 🙂
Versions
@prismicio/next
: 0.1.3next
: 12.2.5Steps to reproduce
next/bundle-analyzer
on v0.1.2 and thenext/image
chunk is not present .next/image
chunk is now there.What is expected?
I would expect the
next/image
chunk to not be included in my project if I don't use the next Image component