Skip to content
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

astro build shows duplicate lines in the log #6489

Closed
1 task
torn4dom4n opened this issue Mar 9, 2023 · 1 comment · Fixed by #6710
Closed
1 task

astro build shows duplicate lines in the log #6489

torn4dom4n opened this issue Mar 9, 2023 · 1 comment · Fixed by #6710
Assignees
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: assets Related to the Assets feature (scope)

Comments

@torn4dom4n
Copy link

What version of astro are you using?

2.1.2

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Windows and Linux

Describe the Bug

I just build my site with Astro v2.1.2 and I see this log:

 generating optimized images 
  ▶ /_astro/me.ff60ed41_1g8my4.jpg (before: 51kb, after: 13kb) (+666ms)
  ▶ /_astro/logo.759d98d5_Z1SJ5Wi.png (before: 3kb, after: 1kb) (+152ms)
  ▶ /_astro/logo.759d98d5_Z1SJ5Wi.png (before: 3kb, after: 1kb) (+112ms)

It shows 2 lines /_astro/logo.759d98d5_Z1SJ5Wi.png (before: 3kb, after: 1kb) (+152ms) at the end.
BTW, in the _astro folder, I see both optimized images and unoptimized images. I think we just need optimized images because it'll reduce the project's size.

Link to Minimal Reproducible Example

https://stackblitz.com/github/torn4dom4n/torn4dom4n.github.io

Participation

  • I am willing to submit a pull request for this issue.
@Princesseuh
Copy link
Member

I see both optimized images and unoptimized images. I think we just need optimized images because it'll reduce the project's size.

This is currently intended, ESM importing an image into the project includes it (so a file gets created), and then using the Image component / getImage creates another asset.

@Princesseuh Princesseuh added the - P2: nice to have Not breaking anything but nice to have (priority) label Mar 9, 2023
@Princesseuh Princesseuh self-assigned this Mar 9, 2023
@Princesseuh Princesseuh added the feat: assets Related to the Assets feature (scope) label Mar 9, 2023
@torn4dom4n torn4dom4n changed the title astro build shows duplicate lines in the log astro build shows duplicate lines in the log Mar 10, 2023
andersk added a commit to andersk/astro that referenced this issue Mar 19, 2023
Hoist the markdownAssetMap loop outside of the bundles loop, so we
don’t unnecessarily re-optimize every image for every bundle.

Fixes withastro#6489; fixes withastro#6564.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
andersk added a commit to andersk/astro that referenced this issue Mar 19, 2023
Hoist the markdownAssetMap loop outside of the bundles loop, so we
don’t unnecessarily re-optimize every image for every bundle.

Fixes withastro#6489; fixes withastro#6564.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: assets Related to the Assets feature (scope)
Projects
None yet
2 participants