Skip to content

Use cssnano to minify main CSS file#569

Merged
yangshun merged 5 commits intofacebook:masterfrom
yangshun:cssnano
Apr 17, 2018
Merged

Use cssnano to minify main CSS file#569
yangshun merged 5 commits intofacebook:masterfrom
yangshun:cssnano

Conversation

@yangshun
Copy link
Contributor

Motivation

As a good front end practice, assets should be minified before sending them down to the browser. First part of #568.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

This addition does not affect development workflow, only the build step. Ran the build step locally and served the static files using a Python webserver.

Before

screen shot 2018-04-15 at 7 20 00 pm

After

screen shot 2018-04-15 at 7 19 11 pm

The minified CSS is 30.4kb, a reduction of 7.7kb from the original 38.1kb (20% savings).

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 16, 2018
@yangshun yangshun requested a review from JoelMarcey April 17, 2018 03:47
Copy link
Contributor

@JoelMarcey JoelMarcey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this -- something that can be noticeable by users and devs alike, I think:

❤️

@yangshun yangshun merged commit 159b80d into facebook:master Apr 17, 2018
@yangshun yangshun deleted the cssnano branch April 17, 2018 04:31
@yangshun yangshun mentioned this pull request Apr 24, 2018
9 tasks
@dgracehmh
Copy link
Contributor

Hi there @yangshun, I was wondering if you tested this change after building and deploying? npm run build. It seems to have broken css functionality for me. See #602 for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants