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(wip): add filesystem cache config for webpack 5 #6323

Draft
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

haoqunjiang
Copy link
Member

@haoqunjiang haoqunjiang commented Mar 1, 2021

New:

  • Turn on filesystem cache by default in webpack 5
  • An addBuildDependencies plugin API for plugins to add additional
    dependencies to the cache config

To Fix:

  • Need to implement a --no-cache option for both serve and build
    command
  • Maybe we should hide the implementation behind a --experimental-cache flag first
  • Need to decide how to deal with .js config files when a random
    environment variable change may affect its exports
  • lintOnSave option needs an overhaul to work better with webpack 5
    and the new cache mechanism
  • Not sure how to test the cache implementation

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

Due to the may-be-buggy cache configuration, it should be considered as a breaking change.

  • Yes
  • No

Other information:

New:
- Turn on `filsystem` cache by default in webpack 5
- An `addBuildDependencies` plugin API for plugins to add additional
dependencies to the cache config

To Fix:
- Need to implement a `--no-cache` option for both `serve` and `build`
command
- Need to decide how to deal with `.js` config files when a random
environment variable change may affect its exports
- `lintOnSave` option needs an overhaul to work better with webpack 5
and the new cache mechanism
- Not sure how to test the cache implementation
@fangbinwei
Copy link
Collaborator

lintOnSave option needs an overhaul to work better with webpack 5 and the new cache mechanism

Some information about lintOnSave needs to be taken into account

When we set lintOnSave: true, CLI will pass emitWarning: true, emitError: false to eslint-webpack-plugin.

In [email protected], it will emit all eslint error as compilation warning.

But after 2.5.0webpack-contrib/eslint-webpack-plugin#46 , it will only emit eslint warning as compilation warning, and doesn't report eslint error. We couldn't see eslint rule error message in console totally, the behavior of emitError and emitWarning is just like its name.

And I believe we can use the default value true of both emitError and emitWarning, and using failOnError, failOnWarning instead according to webpack-contrib/eslint-webpack-plugin#72 webpack-contrib/eslint-webpack-plugin#85

The version of eslint-webpack-plugin is pinned to 2.4.3 in #6291, Is there more information about this?

@haoqunjiang
Copy link
Member Author

And I believe we can use the default value true of both emitError and emitWarning, and using failOnError, failOnWarning instead according to webpack-contrib/eslint-webpack-plugin#72 webpack-contrib/eslint-webpack-plugin#85

Yeah, I think so.

The version of eslint-webpack-plugin is pinned to 2.4.3 in #6291, Is there more information about this?

Somehow the newest version won't re-lint when I run yarn serve the second time in my test project. Haven't figure out the reason yet. But I guess it's related to this PR: webpack-contrib/eslint-webpack-plugin#67

@haoqunjiang haoqunjiang mentioned this pull request Apr 9, 2021
18 tasks
@githoniel
Copy link
Contributor

githoniel commented Aug 12, 2021

I think we should add more file to buildDependencies like babel.config.js, tsconfig.json etc.

For this moment it is best to turn it off by default. It always warning about resolution fail and something not support serialize and will print many error stack

@yoyo837
Copy link

yoyo837 commented Sep 7, 2022

Any update on this?

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

Successfully merging this pull request may close these issues.

4 participants