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

Generated static files are not optimized #568

Closed
2 of 3 tasks
yangshun opened this issue Apr 15, 2018 · 13 comments
Closed
2 of 3 tasks

Generated static files are not optimized #568

yangshun opened this issue Apr 15, 2018 · 13 comments
Labels
better engineering Not a bug or feature request difficulty: intermediate Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR. status: claimed Issue has been claimed by a contributor who plans to work on it.

Comments

@yangshun
Copy link
Contributor

yangshun commented Apr 15, 2018

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
  • Minifies CSS
  • Optimizes image size
@yangshun yangshun added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. difficulty: intermediate Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan. labels Apr 15, 2018
@ahmadalfy
Copy link
Contributor

@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 🕺

@ahmadalfy
Copy link
Contributor

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

@yangshun
Copy link
Contributor Author

yangshun commented May 8, 2018 via email

@yangshun yangshun changed the title Generated static files are not minified Generated static files are not optimized May 8, 2018
@yangshun
Copy link
Contributor Author

yangshun commented May 8, 2018

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 👍

@ahmadalfy
Copy link
Contributor

ahmadalfy commented May 8, 2018

Yes I was going to replace all the original images with the optimized ones in the PR as well 😁

@ahmadalfy
Copy link
Contributor

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

@ahmadalfy
Copy link
Contributor

Should we update the list and remove optimizing the images?

@yangshun
Copy link
Contributor Author

Ok checked "Optimized images". Thanks for reminding

@endiliey endiliey added the better engineering Not a bug or feature request label Jun 2, 2018
@yangshun
Copy link
Contributor Author

If anyone wants to take charge of the HTML minification it would be much appreciated 😄

@yangshun yangshun added help wanted Asking for outside help and/or contributions to this particular issue or PR. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. labels Jun 13, 2018
@ahmadalfy
Copy link
Contributor

ahmadalfy commented Jun 13, 2018 via email

@JoelMarcey JoelMarcey added the status: claimed Issue has been claimed by a contributor who plans to work on it. label Jun 13, 2018
@yangshun
Copy link
Contributor Author

@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 😄

@ahmadalfy
Copy link
Contributor

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

@endiliey
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better engineering Not a bug or feature request difficulty: intermediate Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR. status: claimed Issue has been claimed by a contributor who plans to work on it.
Projects
None yet
Development

No branches or pull requests

4 participants