Docusaurus: Generated static files are not optimized

Created on 16 Apr 2018  ยท  13Comments  ยท  Source: facebook/docusaurus

Is this a bug report?

No

Have you read the Contributing Guidelines on issues?

Yes

Proposal

The generated static files in the build directory upon running yarn build are not minified, which can cause longer load times. Ideally, Docusaurus should have an asset minification pipeline that:

  • [ ] Minifies HTML
  • [x] Minifies CSS
  • [x] Optimizes image size
better engineering intermediate feature good first issue help wanted claimed

Most helpful comment

Let me take care of that ๐Ÿ˜ƒ

On Wed, Jun 13, 2018 at 5:26 AM Yangshun Tay notifications@github.com
wrote:

If anyone wants to take charge of the HTML minification it would be much
appreciated ๐Ÿ˜„

โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/facebook/Docusaurus/issues/568#issuecomment-396802046,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFWO_rixz54bt_hIj2h2a6yVWd8xPVPks5t8IZpgaJpZM4TVs7q
.

>

Ahmad Alfy

alfy.me

All 13 comments

@yangshun I would like to claim the image optimization part. I made some progress that looks good! I integrated imagemin > optipng. Checkout the size difference on the screenshot below ๐ŸŽ†

image

I still need to add optimization for SVG and jpg ๐Ÿ•บ

By the way it increased the build time a few seconds but it is normal.

Cool, it's all yours! Yeah more processing definitely takes time. We can
add in a flag for compression in the build command that is set to true by
default.

On Mon, May 7, 2018, 6:58 PM Ahmad Alfy notifications@github.com wrote:

By the way it increased the build time a few seconds but it is normal.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/facebook/Docusaurus/issues/568#issuecomment-387260349,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABQRHTVeBf4ZUYCZfBjSUGBnNtweOsS6ks5twPuugaJpZM4TVs7q
.

Gosh, BlueWhale.png is 1.3MB. If you don't mind, please help to compress the original image asset down to < 100kb in your PR too ๐Ÿ‘

Yes I was going to replace all the original images with the optimized ones in the PR as well ๐Ÿ˜

I successfully integrated:

  1. imagemin-jpgtrarns for jpg images
  2. imagemin-optipng for png images
  3. imagemin-svgo for svg images
  4. imagemin-gifsicle for gif images

Once we are done with this PR I will push it.

The total size of the images was 4.4 MB and now after the introduction of the images compressors is 2.3 MB

Should we update the list and remove optimizing the images?

Ok checked "Optimized images". Thanks for reminding

If anyone wants to take charge of the HTML minification it would be much appreciated ๐Ÿ˜„

Let me take care of that ๐Ÿ˜ƒ

On Wed, Jun 13, 2018 at 5:26 AM Yangshun Tay notifications@github.com
wrote:

If anyone wants to take charge of the HTML minification it would be much
appreciated ๐Ÿ˜„

โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/facebook/Docusaurus/issues/568#issuecomment-396802046,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFWO_rixz54bt_hIj2h2a6yVWd8xPVPks5t8IZpgaJpZM4TVs7q
.

>

Ahmad Alfy

alfy.me

@ahmadalfy How's your progress for this task? Let us know how we can help. If you are no longer available for this task, just let us know and we can free it up for someone else. Do keep us updated ๐Ÿ˜„

My bad I got hooked with other stuff. Give me one more trial this week and I will get it done

Closing due to stale. Let's free this up. We are getting closer to next major version anyway :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebqq picture sebqq  ยท  3Comments

ericnakagawa picture ericnakagawa  ยท  3Comments

azu picture azu  ยท  3Comments

MoogyG picture MoogyG  ยท  3Comments

itelofilho picture itelofilho  ยท  3Comments