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

fix(webpack5): fix webpack5 cache cannot be invalidated when package.json changes #6375

Merged
merged 3 commits into from
Apr 2, 2021
Merged

Conversation

Map1en
Copy link
Contributor

@Map1en Map1en commented Apr 1, 2021

…rod mode

Checklist
  • npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change

依赖文件变化时,比如echarts4 => echarts5,再build的时候会出现报错。
故使用webpack5 doc推荐的buildDependencies配置监控全依赖,当依赖变化时可以使缓存失效重新构建。

另外dev模式下也有此问题。

@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #6375 (b6a47d8) into master (e18e300) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6375   +/-   ##
=======================================
  Coverage   84.68%   84.68%           
=======================================
  Files         157      157           
  Lines        3564     3564           
  Branches      974      974           
=======================================
  Hits         3018     3018           
  Misses        536      536           
  Partials       10       10           
Impacted Files Coverage Δ
...s/preset-built-in/src/plugins/features/webpack5.ts 26.08% <ø> (ø)

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 e18e300...b6a47d8. Read the comment docs.

@sorrycc
Copy link
Member

sorrycc commented Apr 1, 2021

__filename 不是当前文件吗?怎么能监听到 package.json 的变更?

@Map1en
Copy link
Contributor Author

Map1en commented Apr 1, 2021

__filename 不是当前文件吗?怎么能监听到 package.json 的变更?

已修改

@sorrycc
Copy link
Member

sorrycc commented Apr 2, 2021

其实不止 package.json 的变更的,还有 webpack 配置的变更,不过这个可以先合。

@sorrycc sorrycc changed the title fix(webpack5): fix webpack5 cache cannot be invalidated normally in p… fix(webpack5): fix webpack5 cache cannot be invalidated when package.json changes Apr 2, 2021
@sorrycc sorrycc merged commit ac6b802 into umijs:master Apr 2, 2021
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

2 participants