Skip to content

enable babel-loader cache #10083

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

Merged
merged 2 commits into from
Feb 1, 2020
Merged

Conversation

silverwind
Copy link
Member

This speeds up repeated webpack builds by around 20%. It will use the default cache directory node_modules/.cache/babel-loader.

@silverwind
Copy link
Member Author

silverwind commented Jan 31, 2020

One invalidation issue to be aware of is babel/babel-loader#690. It could probably be worked around via make:

node_modules/.cache/babel-loader: package-lock.json
  rm -rf $@
  mkdir -p $@

$(WEBPACK_DEST): $(WEBPACK_SOURCES) | node_modules node_modules/.cache/babel-loader

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 31, 2020
@codecov-io
Copy link

codecov-io commented Jan 31, 2020

Codecov Report

Merging #10083 into master will increase coverage by <.01%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10083      +/-   ##
==========================================
+ Coverage   43.45%   43.45%   +<.01%     
==========================================
  Files         566      566              
  Lines       78987    78989       +2     
==========================================
+ Hits        34322    34324       +2     
- Misses      40427    40429       +2     
+ Partials     4238     4236       -2
Impacted Files Coverage Δ
services/pull/pull.go 33.93% <0%> (ø) ⬆️
routers/repo/branch.go 55.72% <100%> (+0.34%) ⬆️
models/unit.go 37.03% <0%> (-2.47%) ⬇️
modules/log/event.go 64.61% <0%> (-1.03%) ⬇️
routers/repo/view.go 38.59% <0%> (-0.88%) ⬇️
services/pull/patch.go 67.92% <0%> (ø) ⬆️
models/repo.go 51.46% <0%> (+0.13%) ⬆️
services/pull/temp_repo.go 34.18% <0%> (+2.56%) ⬆️
modules/process/manager.go 78.31% <0%> (+3.61%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d736c2...aef3c5c. Read the comment docs.

@silverwind
Copy link
Member Author

Cache invalidation added for changes to package.json or package-lock.json.
Also added webpack.config.js as a prereq to the webpack step as well.

@silverwind silverwind force-pushed the babel-loader-cache branch 3 times, most recently from a82a99f to fe0aa41 Compare February 1, 2020 03:22
@silverwind
Copy link
Member Author

Rewrote cache invalidation to use cacheIdentifier option and not depend on make any more.

@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Feb 1, 2020
this speeds up repeated webpack builds by around 20%. It will use the
default cache directory `node_modules/.cache/babel-loader`.

Also added cache invalidation to workaround babel/babel-loader#690
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 1, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 1, 2020
@zeripath zeripath merged commit 6dcf110 into go-gitea:master Feb 1, 2020
@silverwind silverwind deleted the babel-loader-cache branch February 5, 2020 22:43
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants