shellscape/koa-webpack

UNMET PEER DEPENDENCY webpack@2.1.0-beta.27

Closed this issue · 5 comments

I have this version installed though:

"devDependencies": {
"koa-webpack": "^0.1.9",
"nodemon": "^1.11.0",
"webpack": "2.1.0-beta.27"
},

I also have 2.1.0-beta.27 installed globally.

Also, is it a good idea to depend on a beta version of webpack? What's the reason behind it? Seems like this would make the build unstable. We just need a version of this that works and is reliable. Desperately.

Yeah for some reason NPM doesn't recognize "tagged" version numbers, or a valid semver followed by a hyphenated string, as meeting a peer dependency. If you've got a solution to that, please reopen this issue or just drop another comment and I'll update the package.

Regarding the followup - 2.1.x is extremely close to full release, and koa-webpack is only tested to work with webpack v2+. That fragmentation was bound to occur, just ask the Koa 1 vs 2 fragmentation has already started. Would it be a good idea to depend on a beta version if this was for production? Not in the slightest. But it's perfectly fine given that this is only intended to be used in a development environment.

Ah, I see. But what if you need to use koa2 in prod?

The school of thought is that you should be building your asset bundle with webpack in the same way, and deploying them. I wouldn't recommend hot reload for any production environment (and I'm not sure anyone else would). You don't need webpack's dev middleware for production environments either. The two packages that koa-webpack wraps - webpack-dev-middleware and webpack-hot-middleware - are just for development.

Ah, yes, that makes sense. Still, I feel like having a beta version of anything in peer dependencies is really odd, and a bad idea. It may not be deployed to prod, but projects that are serious and need to work are still compromised. I, for example, gave up on trying to make this work, and am waiting until webpack 2 drops before I try again. Till then, I'm going without hmr.

Instead of bikeshed'ing the version of the peerDependency (which really is inconsequential, as it's just a warning), I think most would suggest creating an issue covering what wasn't working, and including details on your setup. That'd be far more productive.

If you've thrown in the towel, you can always try https://github.com/leecade/koa-webpack-middleware, which depends on much older versions of the composed middleware, which in turn depends on much older version(s) of webpack.