webpack3 is coming

Created on 20 Jun 2017  Â·  27Comments  Â·  Source: vuejs-templates/webpack

so when upgrade?

enhancement intend to implement

Most helpful comment

@MaxMilton same problem
l remove

// compiler.plugin('compilation', function (compilation) {
//     compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
//         hotMiddleware.publish({action: 'reload'});
//         cb()
//     })
// });

now hot updates is ok

All 27 comments

I played with it a little bit and had problems with webpack-hot-middleware not doing hot updates correctly but rather reloading the whole page. Other than that things worked as expected, however, I didn't do any in-depth testing.

@MaxMilton same problem
l remove

// compiler.plugin('compilation', function (compilation) {
//     compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
//         hotMiddleware.publish({action: 'reload'});
//         cb()
//     })
// });

now hot updates is ok

How to fix this warning 🤔

â § building for production...(node:91029) DeprecationWarning: Chunk.modules is deprecated. Use Chunk.getNumberOfModules/mapModules/forEachModule/containsModule instead.

There's still some plugins that we rely on that have to release compatible versions (`extract-text-webpack-plugin andhtml-webpack-plugin` among them) so we will wait for those issue to resolve before we make the jump.

@LinusBorg extract-text-webpack-plugin and html-webpack-plugin have been updated to support webpack 3. inject-loader has still not been updated though.

Do you know what issues exist with inject-loader with webpack 3?

There was a PR merged in which allowed webpack 3 peer dependency. But not released.

@limichange I think this warning was coming from extract-text-webpack-plugin.

DeprecationWarning: Chunk.modules is deprecated.

Looks to be fixed - extract-text-webpack-plugin/CHANGELOG.md#breaking-changes

@sudo-suhas thx!

I've opened an issue with inject-loader: https://github.com/plasticine/inject-loader/issues/46

I believe this is the last package now which needs updating before we can work on our own webpack 3 compatibility.

Update: inject-loader 3.0.1 is now published with webpack 3 compatibility.

Thanks for the heads-up! I guess we should be looking to upgrading this template now.

This still doesn't work from me. Am I missing something?

I've:

I assume I shouldn't actually do https://github.com/vuejs-templates/webpack/issues/751#issuecomment-309955295 because it'll break other stuff.

cc @sudo-suhas @LinusBorg

+1 still have HMR failed problem with the same versions

@adam-lynch I don't think it is as simple as updating all the package dependency versions. While webpack@3 was a backward compatible release for the most part, there are evidently differences in behavior which are breaking the hot reload. Let's wait for the repo maintainers to update.

@adam-lynch you might have issues with webpack-dev-middleware: ^1.12.0, in my projects I'm keeping it at version 1.11.0 ; "webpack-dev-middleware": "~1.11.0"

This template doesn't have official support for webpack 3 yet so you can't expect it to magically work if you just upgrade all the packages. You can upgrade all packages (other than webpack-dev-middleware) and use the workaround in https://github.com/vuejs-templates/webpack/issues/751#issuecomment-309955295 but understand this will make HMR work at the cost of reduced functionality (no page reload when the html-webpack-plugin template changes).

Concern this all the time. Waiting for good news!

Does this change anything? Stabilizing webpack 3 (week 18–19)

So I was looking into this again, and it seems that there is a general problem with that html-webpack-plugin:

https://github.com/jantimon/html-webpack-plugin/issues/680

So think we should implement the workaround of https://github.com/vuejs-templates/webpack/issues/751#issuecomment-309955295 in our template until the problem for that pluign has been resolved by its maintainers.

@LinusBorg what are the downsides to that exactly? That if you edit index.html (at the root of your project), your app won't reload?

yep, that's all, pretty much.

I just submitted a PR for webpack 3 here, you can easily check it out with

vue init webpack#webpack_3

It would be great if a few folks could take this for a quick spin and report that everything is working for them.

When I run vue init webpack#webpack_3, I got Failed to download repo vuejs-templates/webpack#webpack_3: Response code 404 (Not Found)

How should I fix this, please?

The branch has been merged.. No need to specify the branch

@sudo-suhas but my newly generated project still has "webpack": "^2.6.1"?

My bad. Try vue init webpack#develop

I've been keeping an eye on this issue but it might not receive any more comments so I hope you don't mind but I created #1022 to track when the hot reloading of the root html file will work again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Joshfindit picture Joshfindit  Â·  3Comments

Splode picture Splode  Â·  3Comments

ghost picture ghost  Â·  3Comments

SSmale picture SSmale  Â·  3Comments

brucejcw picture brucejcw  Â·  4Comments