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!: support and use webpack 5 as default #6060

Merged
merged 49 commits into from
Dec 3, 2020

Conversation

haoqunjiang
Copy link
Member

@haoqunjiang haoqunjiang commented Nov 16, 2020

Work-in-Progress

TODOs

  • Fix vuepress integration
  • Document the breaking changes
  • Fix the few remaining failing tests
    • UI: Needs to fix DashboardPlugin
    • PWA plugin: Needs to use workbox v6 for webpack 5 support
    • Mocha plugin: Works after bailing out to webpack 4
  • Webpack 4 support:
    • It's currently possible with yarn resolutions
    • Can be tested with Jest aliases
    • NPM users can use module-alias to redirect all requests to the webpack package

Later

  • Mocha: Needs to fix Vue 3 setup (could be in another PR, as it has been failing for a while and depends on a vue-loader patch)
  • Mochapack's webpack 5 support is still work-in-progress Add support for webpack v5 sysgears/mochapack#83
  • style-related loaders need to be updated for better support of webpack 5 (there's basic support in the currently used versions, though)
  • webpack-dev-server 4 is in early beta, it provides better compatibility with webpack 5. But the current version is still usable, so no hurry in updating it.
  • Global serve/build: Tests are ignored for now, these features will be removed in another PR
  • Preload plugin: Should support html-webpack-plugin v4. Not high-priority, but should be easy

Note

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)

  • Yes
  • No

Other information:

Work-in-Progress

TODOs:
- Support opting-out to webpack 4
- Document the breaking changes
- Fix the few remaining failing tests
- Fix Vue 3 test setup (maybe in another PR)
- Preload plugin should support html-webpack-plugin v4
@haoqunjiang haoqunjiang mentioned this pull request Nov 17, 2020
18 tasks
webpack 4 compat is too cumbersome and let's forget about that for now
This avoids incorrect hoisting caused by vuepress sharing the vue-loader
dependency, which falsely injects webpack v4 into the dependencies of
vue-loader v15.

Also added a hot fix for vue-cli-plugin-apollo
workbox-webpack-plugin upgraded from v4 to v6 alpha. Need further
testing to make sure it works correctly. But for now, at least the
existing tests have passed
In webpack 5, compilation.asset is a SizeOnlySource, so we have to
read the source directly from the fs
It's a little bit tricky to update this plugin. So we'll reconsider it
later.
note: dev server hmr is not working correctly
@haoqunjiang
Copy link
Member Author

All tests are passing. I think it's ready for merge now!

@haoqunjiang haoqunjiang merged commit 2dbe0be into vuejs:dev Dec 3, 2020
@haoqunjiang haoqunjiang deleted the feat-webpack-5 branch December 3, 2020 07:16
@haoqunjiang haoqunjiang restored the feat-webpack-5 branch December 3, 2020 07:17
@faraz5040
Copy link

@sodatea What's the status of webpack-dev-server v4 support?

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.

2 participants