catamphetamine / universal-webpack

Isomorphic Webpack: both on client and server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide a webpack 2 example

ignatevdev opened this issue · comments

Hi.
I have been using universal-webpack for a while and recently became curious in migrating my project to webpack 2. However, even though in one of the closed issues you mention that universal-webpack should be working with webpack 2 - it doesn't, since passing one raw configuration through webpack 2 works and trying to wrap it in the client_configuration - throws an error "TypeError: undefined is not iterable!".

I couldn't find a source of that error in the configuration though, but I think that it would be really useful if you could try to migrate this project to webpack 2.

Thanks.

Webpack 2 works for me with this project.

npm install webpack@2.1.0-beta.21
npm install extract-text-webpack-plugin@2.0.0-beta.4

// Then remove OccurrenceOrderPlugin

It might work with the beta.21, but it will fail at the latest and above. Are you going to do anything about it?

I will make it work with Webpack 2 once it is released and stabilised (along with the corresponding 3rd party plugins).
Until then you can fork this repo and create a pull request called "Webpack 2" in which you're gonna keep the project working and up-to-date with the latest beta version of Webpack 2.

commented

I can confirm this. I don't think that the webpack beta version matters, but if you migrated to the new config syntax of webpack2 the loaders iterations will fail.

So if you changed your configuration in webpack.conf from module.loaders to module.rules it will throw a TypeError: undefined is not iterable. You can basically change that back to module.loaders and it will work just fine (webpack2 has backwards compatibility on this).

Ok then, make up a sample repo, tell me the command and the error message,
and i'll have a look this evening

On Thursday, November 3, 2016, Aris notifications@github.com wrote:

I can confirm this. I don't think that the webpack beta version matters,
but if you migrated to the new config syntax of webpack2 the loaders
iterations will fail.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#38 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAdH783lSbjsQV6C9U14Qm2Xb-T1lcJPks5q6cw3gaJpZM4KkqEi
.

Since none of you provided me with a sample project reproducing the issues I made it myself and added the instructions on running webpack-react-redux-isomorphic-render-example with Webpack 2 to that repo.
catamphetamine/webpack-react-redux-server-side-render-example@952a9c7
universal-webpack has no dependency onWebpack version and worked (and works) with any Webpack version.
This repo is no place for this issue.

Wow, this might be very useful, will definitely check it out. I could post a repo, but I agree with you on the point of waiting for the stable release of the webpack 2, since the config might change multiple times by that time.

However, thank you anyway.

I'm personally not a fan of going with the latest hot stuff since it's almost always means finding bugs and googling the hell out of the internet.

I agree, and to be honest, while trying to state the main features in webpack 2 and googling to make sure I'm correct I have found out that those things can be done with wepback 1 as well, but their support will not be native and might have some troubles to get it working. Nevertheless I would probably stick with your opinion on this one.

Webpack 2 introduces tree shaking.
Which is gonna eliminate unused code and reduce bundle size drastically.
Well, at least that's how everyone thought.
Except it still doesn't work and that's the reason it says BETA.
webpack/webpack#2867

Interesting. Then the effort of fixing the errors during migration to the new version are completely not worth it, since I've done everything like in your example and some more things, but still got problems with resolving paths.

Post your errors

Sure, but gonna do it tomorrow

Back here again. My error is not anyhow related to this project, it's a webpack's issue, however, it appears because the new webpack disallows to add an empty string into resolve extensions, and it leads to a fail in the processing of some of the node_modules. But, as I said, since it's not related to this project, I leave it here only because you asked

FYI the newest 0.2.0 release now only supports Webpack 2.
It works for my project.
If you find any bugs in the new version then create an issue.