question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack 5 support

See original GitHub issue

https://webpack.js.org/blog/2020-10-10-webpack-5-release/ https://webpack.js.org/migrate/5/

webpack 5 is out and it’s time we go way down into that rabbit hole 😄

We’ll use this issue to keep track of everything. We plan to ship Quasar 2 with Webpack 5 support, or add it right after with a @quasar/app update, ~but could push back the upgrade to Quasar 3 if we find out there are too many breaking changes for devs~ this is needed as some webpack 4 issues are pretty severe

If anyone from team or community wants to jump in and point out something we are missing, both on current issues or new features we can leverage, please do 😃

Let’s avoid spam and “+1”, we are going to delete/hide those comments

Existing issues due to webpack 4

New feature we want to leverage from webpack 5

Loaders to upgrade

  • autoprefixer Latest (v10.0.4) supports new plugin structure of postcss (v8). Current is v9.8.6
  • compression-webpack-plugin supports webpack 5 since v5, we already ship with v5.0.1. May be a good idea to update to latest anyway (v7), which drops support for webpack 4
  • copy-webpack-plugin supports webpack 5 since 6.0.4, we already ship with v6.3.2
  • css-loader supports webpack 5 since 3.3.2, we already ship with v3.6.0. May be a good idea to update to latest anyway (v5)
  • eslint-loader is deprecated and apparently doesn’t support webpack 5. Replacing with eslint-webpack-plugin (see https://github.com/facebook/create-react-app/pull/9751), which in turn forces us to use at least ESLint 7
  • file-loader supports webpack 5 since 5.0, we already ship with v6.2.0 which is latest loader version
  • fork-ts-checker-webpack-plugin: ~we are on v4 right now, we need to upgrate to v6, webbpack 5 is there since v5~ upgraded to v6
  • friendly-errors-webpack-plugin have not released a new version since 2018, and is currently not compatible with webpack 5, at least not when installed via NPM. There a fork we could use which supports v5
  • html-webpack-plugin: we are on v4.5 right now, v5 is currently in beta and will have webpack 5 support (and drop webpack 4 support)
  • mini-css-extract-plugin supports webpack 5 since 0.11 but many improvements to the support has been made in 1.x releases (latest is v1.3.1), we currently ship with v0.10
  • node-loader supports webpack 5 since 1.0, we already ship with v1.0.2 which is latest loader version
  • optimize-css-assets-webpack-plugin won’t support webpack 5, its readme suggests to use css-minimizer-webpack-plugin instead
  • postcss-loader supports webpack 5 since v4, we currently ship with v3
  • postcss-rtl Has not been updated to new plugin structure of postcss (v8). Recommend moving to rtlcss. Until we do that, we can rely on temporary fork (or create our own fork) which fixes the compatibility issues
  • pug-plain-loader (used in docs) ~not updated since years, webpack 5 status support unknown. Consider using this updated fork instead~ Updated in december to support Pug 3 and webpack 5
  • raw-loader (used in docs) supports webpack 5 since 4.0, we already ship with v4.0.0 which is latest loader version
  • sass-loader supports webpack 5 since 8.0, we already ship with v10.1.0 which is latest loader version
  • terser-webpack-plugin supports webpack 5 since v4.2.1, we ship with v4.1.0. May be a good idea to update to latest anyway (v5.0.3)
  • ts-loader ~supports webpack 5 apparently since v8.0.1, we ship with v7.0.5.~ We already ship with v8, we may consider upgrade to v9 (drops webpack v4 support and require node v12).
  • url-loader supports webpack 5 since 3.0, we already ship with v4.1.1 which is latest loader version
  • vue-loader supports webpack 5 since v15, we already ship with v15.9.5 which contains latest fix for it, nothing to do here
  • vue-style-loader have not released a new version since 2018. Since it was created to support SSR, and Vue3 SSR support hasn’t been finished yet, this actually makes sense. Many are starting to question if that loader is still useful, I’d say we’ll only know when Vue3 supports SSR
  • webpack-bundle-analyzer supports webpack 5 since v4.0, we already ship with v4.1.0 which is latest loader version
  • webpack-chain somewhat works with webpack 5, but hasn’t been updated to fully support it. Something may move in some months tho
  • webpack-dev-server already supports webpack 5, but have some issues which should be fixed in v4, currently in very early beta. We currently ship with v3.11
  • webpack-merge supports correct typings for webpack 5 since v5.3.0 (should be compatible even before that release), we ship with v4.2.2
  • webpack-node-externals supports webpack 5 since v2.5.0, we already ship with v2.5.2 which is latest loader version
  • workbox-webpack-plugin will support webpack 5 since v6 ~(currently in RC phase)~. We should ditch v5 support and update everything to use v6 only.
  • write-file-webpack-plugin should not be needed anymore since webpack-dev-server v3.1.10 which exposes a writeToDisk option. This dependency should be removed

Issues with webpack 5 migration

Related issues

Things which could be explored, but which aren’t really “in-scope” for the migration

Additional context Vue CLI still has not switched, but something is moving:

React is moving there too and have an exaustive list of stuff to upgrade and problems to solve:

Angular CLI already supports Webpack 5 as experimental (we could check if we can learn something from their code), and is discussing about Module Federation feature:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

9reactions
rstoenescucommented, Apr 24, 2021

@quasar/app” v3.0.0-beta.16 will feature Webpack 5. Was hell upgrading everything (including our many of custom webpack plugins). But while I was at it, took time to also greatly improve and revamp the inner workings of q/app (and there are so many to list them here!). Get ready to rock’n’roll your apps with it!

7reactions
rstoenescucommented, Apr 16, 2021

We need to first concern about our current user base and not leave them hanging with their current apps. Due to Webpack team not upgrading chokidar dependency for Webpack 4 we can’t have apps correctly running on Node 14+ (which is LTS!).

We are aware of how good Vite is, which is why we’ve planned a Vite plugin and even a Quasar CLI based on Vite instead of Webpack. It will come, guaranteed. I’m about to finalize the Webpack 5 upgrade (a few more days and there’s going to be a q/app release with it) and then it’s Vite time!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack 5 release (2020-10-10)
Webpack 5 adds support for some CommonJs constructs, allows to eliminate unused CommonJs exports and track referenced export names from require ...
Read more >
facebook/create-react-app - Webpack 5 support overview
Overview of tasks needed for updating CRA to Webpack 5 - Some of the work will support both Webpack 4 + 5 but...
Read more >
What's New in Webpack 5 - Frontend Digest
What's new in Webpack 5 · Faster builds with persistent caching · Smaller bundle sizes · Better long term caching · Breaking changes...
Read more >
Upgrading Webpack 4 → 5 | Square Corner Blog
Webpack 5 Gains · Decreased bundle size by 27-28% · Decreased build time by 10% (2m 54s → 2m 36s) · Cached dev...
Read more >
Webpack 5 Adoption - Next.js
Improved Long Term Caching of Assets: Deterministic code output that is less likely to change between builds; Improved Tree Shaking; Support for assets...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found