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

Provide a webpack 2 example #38

Closed
ignatevdev opened this issue Oct 31, 2016 · 15 comments
Closed

Provide a webpack 2 example #38

ignatevdev opened this issue Oct 31, 2016 · 15 comments

Comments

@ignatevdev
Copy link

ignatevdev commented Oct 31, 2016

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.

@catamphetamine
Copy link
Owner

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

@ignatevdev
Copy link
Author

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

@catamphetamine
Copy link
Owner

catamphetamine commented Nov 1, 2016

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.

@aris-b
Copy link

aris-b commented Nov 3, 2016

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).

@catamphetamine
Copy link
Owner

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
.

@catamphetamine
Copy link
Owner

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.

@ignatevdev
Copy link
Author

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.

@catamphetamine
Copy link
Owner

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.

@ignatevdev
Copy link
Author

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.

@catamphetamine
Copy link
Owner

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

@ignatevdev
Copy link
Author

ignatevdev commented Nov 5, 2016

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.

@catamphetamine
Copy link
Owner

Post your errors

@ignatevdev
Copy link
Author

Sure, but gonna do it tomorrow

@ignatevdev
Copy link
Author

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

@catamphetamine
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants