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

feat(webpack): enable babel cache to make rebuild faster #1774

Closed
wants to merge 1 commit into from

Conversation

chenjiahan
Copy link
Member

PR Details

Description

Enable babel loader cache because:

  1. babel-loader cache can speed up the rebuild time (tested on large projects).
  2. webpack cache get invalid in many cases, such as config changed, while babel cache is still valid.

Revert: #926

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have updated changeset
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2022

🦋 Changeset detected

Latest commit: 0a524d1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 150 packages
Name Type
@modern-js/webpack Patch
@modern-js/plugin-storybook Patch
@modern-js/runtime Patch
@modern-js/plugin-testing Patch
@modern-js/app-tools Patch
@modern-js/plugin-bff Patch
@modern-js/plugin-tailwindcss Patch
@modern-js/plugin-garfish Patch
@modern-js/plugin-nest Patch
@integration-test/alias-set Patch
api-service-koa Patch
async-entry-test Patch
bff-express Patch
basic-module Patch
composes-basic Patch
composes-external Patch
dev-module Patch
diff-suffix-module Patch
global-module Patch
prod-module Patch
css Patch
antd-less Patch
bad-nested-npm-import Patch
bad-npm-import Patch
base-import Patch
css-ts-declaration Patch
disable-source-map Patch
exclude-less Patch
exclude-sass Patch
import-common-css Patch
inline-css-url Patch
keep-css-url Patch
less-import Patch
less-inline-js Patch
less-npm-import Patch
multi-css Patch
multi-less Patch
multi-sass Patch
nested-npm-import Patch
npm-import Patch
single-css Patch
single-less Patch
single-sass Patch
tips-to-install-less-plugin Patch
twin-macro Patch
css-modules Patch
esbuild-minify-js Patch
@cypress-test/garfish-dashboard Patch
@cypress-test/garfish-main Patch
@cypress-test/garfish-table Patch
always-inline Patch
always-url Patch
assets-in-css Patch
inline-limit Patch
tmp Patch
file-based-router Patch
use-loader Patch
server-config Patch
server-prod Patch
init Patch
testing-app Patch
tests Patch
@modern-js/babel-preset-app Patch
@modern-js/babel-preset-base Patch
@modern-js/babel-preset-lib Patch
@modern-js/babel-preset-module Patch
@modern-js/core Patch
@modern-js/css-config Patch
@modern-js/plugin-changeset Patch
@modern-js/plugin-esbuild Patch
@modern-js/plugin-i18n Patch
@modern-js/plugin-jarvis Patch
@modern-js/plugin-less Patch
@modern-js/plugin-proxy Patch
@modern-js/plugin-sass Patch
@modern-js/plugin-ssg Patch
@modern-js/new-action Patch
@modern-js-app/eslint-config Patch
@modern-js/eslint-config Patch
@modern-js/tsconfig Patch
@modern-js/bff-core Patch
@modern-js/bff-runtime Patch
@modern-js/server-core Patch
@modern-js/create-request Patch
@modern-js/plugin-egg Patch
@modern-js/plugin-express Patch
@modern-js/plugin-koa Patch
@modern-js/plugin-polyfill Patch
@modern-js/plugin-server Patch
@modern-js/prod-server Patch
@modern-js/server Patch
@modern-js/server-utils Patch
@modern-js/builder-doc Patch
@modern-js/module-tools Patch
@modern-js/monorepo-tools Patch
@modern-js/create Patch
@modern-js/e2e Patch
@modern-js/node-bundle-require Patch
@modern-js/plugin Patch
@modern-js/types Patch
@modern-js/upgrade Patch
@modern-js/utils Patch
@modern-js/babel-compiler Patch
@modern-js/style-compiler Patch
@scripts/build Patch
@scripts/check-changeset Patch
@scripts/codemod Patch
@scripts/jest-config Patch
@scripts/lint-package-json Patch
@scripts/prebundle Patch
@scripts/vitest-config Patch
esbuild-integration Patch
@integration/module-tools-cli Patch
@integration/module-tools-build-config-bundleless Patch
@integration/module-tools-build-config Patch
@integration/module-tools-build-legacy Patch
@integration/module-tools-build-preset Patch
@integration/module-tools-build Patch
@integration/module-tools Patch
runtime Patch
ssr Patch
webpack-builder-test Patch
@e2e/webpack-builder-basic Patch
@modern-js/builder-web-site Patch
@modern-js/website Patch
@modern-js/webpack-builder Patch
@modern-js/generator-common Patch
@modern-js/generator-plugin Patch
@modern-js/generator-utils Patch
@modern-js/electron-generator Patch
@modern-js/electron-independence-generator Patch
@modern-js/entry-generator Patch
@modern-js/generator-generator Patch
@modern-js/module-generator Patch
@modern-js/monorepo-generator Patch
@modern-js/mwa-generator Patch
@modern-js/storybook-generator Patch
@modern-js/test-generator Patch
@modern-js/upgrade-generator Patch
@modern-js/generator-plugin-plugin Patch
@modern-js/repo-generator Patch
@modern-js/generator-cases Patch
@modern-js/base-generator Patch
@modern-js/bff-generator Patch
@modern-js/changeset-generator Patch
@modern-js/dependence-generator Patch
@modern-js/eslint-generator Patch
@modern-js/server-generator Patch
@modern-js/ssg-generator Patch
@modern-js/tailwindcss-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Sep 27, 2022

Codecov Report

Base: 56.97% // Head: 57.00% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (0a524d1) compared to base (d3795e8).
Patch coverage: 90.47% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1774      +/-   ##
==========================================
+ Coverage   56.97%   57.00%   +0.03%     
==========================================
  Files         625      625              
  Lines       15917    15934      +17     
  Branches     3377     3381       +4     
==========================================
+ Hits         9068     9083      +15     
- Misses       6319     6321       +2     
  Partials      530      530              
Impacted Files Coverage Δ
packages/cli/webpack/src/utils/getBabelOptions.ts 95.34% <90.00%> (-4.66%) ⬇️
packages/cli/webpack/src/config/features/babel.ts 97.22% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@chenjiahan
Copy link
Member Author

The rebuild slow problem is caused by react-refresh-webpack-plugin not babel, so this PR can be closed.

pmmmwh/react-refresh-webpack-plugin#669

@chenjiahan chenjiahan closed this Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant