Skip to content

feat(v2): add cache-loader by default especially on babel-loader#1335

Merged
yangshun merged 1 commit into
facebook:masterfrom
endiliey:cache
Apr 3, 2019
Merged

feat(v2): add cache-loader by default especially on babel-loader#1335
yangshun merged 1 commit into
facebook:masterfrom
endiliey:cache

Conversation

@endiliey
Copy link
Copy Markdown
Contributor

@endiliey endiliey commented Apr 3, 2019

Motivation

Add https://github.com/webpack-contrib/cache-loader/ by default especially on expensive loader like babel-loader.

Also add --no-cache-loader cli option if user don't want it.

How it works:
Caches the result of following loaders on disk

cache-loader-3

See test plan for benefits

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

Yarn start

With cache-loader. Subsequent build is faster due to reuse of cache

cache-loader-2

Without cache loader, roughly similar performance
no-cache-loader

Yarn build

With cache-loader
yarn build cache-loader

Without cache-loader
yarn build no cache-loader

Notes:

Lot of possibility for improvement in the future. Just adding it for now

@endiliey endiliey requested a review from yangshun as a code owner April 3, 2019 18:44
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 3, 2019
@docusaurus-bot
Copy link
Copy Markdown
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit a658d67

https://deploy-preview-1335--docusaurus-2.netlify.com

@docusaurus-bot
Copy link
Copy Markdown
Contributor

Deploy preview for docusaurus-preview ready!

Built with commit a658d67

https://deploy-preview-1335--docusaurus-preview.netlify.com

Comment thread packages/docusaurus/bin/docusaurus.js
@yangshun yangshun merged commit 94a4ef5 into facebook:master Apr 3, 2019
@endiliey endiliey deleted the cache branch April 4, 2019 04:11
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