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 compatibility with webpack 5 #698

Merged
merged 20 commits into from
Feb 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: compatibility with webpack v5
  • Loading branch information
alexander-akait committed Feb 9, 2021
commit f2c95d146d666eb896a17c6f06dc42fdbc2d8a1c
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,15 @@ class MiniCssExtractPlugin {
pluginName,
(result, { chunk }) => {
const { chunkGraph } = compilation;
// TODO remove after drop webpack v4
const { HotUpdateChunk } = compiler.webpack
? compiler.webpack
: // eslint-disable-next-line global-require
require('webpack');

// We don't need hot update chunks for css
// We will use the real asset instead to update
if (chunk instanceof compiler.webpack.HotUpdateChunk) {
if (chunk instanceof HotUpdateChunk) {
return;
}

Expand Down