Mini-css-extract-plugin: support webpack@5

Created on 25 Dec 2018  ·  11Comments  ·  Source: webpack-contrib/mini-css-extract-plugin

...... /node_modules/mini-css-extract-plugin/dist/index.js:217
      mainTemplate.hooks.requireEnsure.tap(pluginName, (source, chunk, hash) => {
                                       ^

TypeError: Cannot read property 'tap' of undefined
    at compiler.hooks.thisCompilation.tap.compilation (/Users/santosv/workspace/webpack-boilerplate/node_modules/mini-css-extract-plugin/dist/index.js:217:40)
    at SyncHook.eval [as call] (eval at create (/Users/santosv/workspace/webpack-boilerplate/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:9:1)
    at SyncHook.lazyCompileHook (/Users/santosv/workspace/webpack-boilerplate/node_modules/tapable/lib/Hook.js:154:20)
    at Compiler.newCompilation (/Users/santosv/workspace/webpack-
3 (important) patch 3 (broken) feature

Most helpful comment

Yes, fixing HMR is on our roadmap (current or next week), maybe we found time faster for this

All 11 comments

Looks like “MainTemplate.hooks.requireEnsure removed”: https://github.com/webpack/changelog-v5/blob/master/README.md#other-minor-changes

Feel free to send a PR

Any ETA on this one?

No ETA, but when webpack@5 was released, plugin already support webpack@5

@evilebottnawi as I noticed in the feedback summary, it's stated that it's not compatible yet.

I would really like to use mini-css-extract-plugin with webpack 5

However, it looks like it won't work before webpack 5release.
So far I have found an alternative.

extract-css-chunks-webpack-plugin

I can confirm no warnings or errors are produced with webpack@>=5.0.0-beta.23 and mini-css-extract-plugin@^0.11.0. (#477, #571, #573)

Yes, fixing HMR is on our roadmap (current or next week), maybe we found time faster for this

Was this page helpful?
0 / 5 - 0 ratings