Next.js: Migrate to Webpack 4

Created on 1 Mar 2018  路  12Comments  路  Source: vercel/next.js

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Context

We 鉂わ笍next.js! I made the (possibly) poor decision of migrating our (nteract's) monorepo to Webpack 4 only to notice that next.js is on webpack 3. How far off is a migration to webpack 4? My primary reason for asking is to know if I should switch us _back_ to webpack 3 or just wait on the next next version. 馃槃

We have a few non-next.js apps (some loaded by a python server, one by electron) and we want to make the webpack similar using the universal webpack configurator plugins crafted for next 4. I don't want to break our next apps, so I kept those a bit separate.

Most helpful comment

I have something in the works. No ETA though.

All 12 comments

I have something in the works. No ETA though.

Looks like webpack-dev-middleware just upgraded, which should help a lil' bit.

https://github.com/webpack/webpack-dev-middleware/pull/267

If I'm going to start a new project, will it be hard to migrate from the current version of nextjs to a version using webpack 4?

As long as you run the latest version of Next.js we're not going to break much.

any progress on this? can i help? i recently migrated a big project to webpack 4.

I just in progress to reload the project with web pack 4
I use it already , work good with last dev-middleware/hot middleware and some code adjustment,
Personnaly i removed the feature ondemand in this.. i adjusted hot-reload with the last
Soon will provide the link

Here my work for webpack4 (i just did tested on browser only )

A little boilerplate using no babelified code of source nextJs inside with feature like hot-reload completely working with css,css and js

I changed a bit the core of nextjs to make all works .. i wait for any questions

https://github.com/simonjoom/NextJs4Reloaded

Please read
https://github.com/simonjoom/NextJs4Reloaded#feature-tested

4332

From my comment here: https://github.com/zeit/next.js/issues/4332#issuecomment-388333203

As said on twitter I wouldn't recommend using this since it removes a lot of features / is not tested. But we can sure copy a few things.

Either way there's no need for an extra issue.

Duplicate of #3923

Thanks for sharing 馃檹

Hi

I see that there is not much activity i the add/webpack4 branch.

Since the release of webpack 4 , next.js v6 has been released without support for webpack 4, I assumes that is because it's a bit tricky or more work then expected to get webpack 4 to work with next.js?

Is there anything we as a community can do to help with this?

Are you able to outlines the steps that you guys want to take to get webpack 4 into next.js?
If we are able to break this into smallere pieces I'm sure more people will join in and help us get this done!

:heart: Great work on next! use it in so many apps! :heart:

If we are able to break this into smallere pieces I'm sure more people will join in

The problem with Webpack 4 right now is that it requires a big refactor of certain parts of how Next works right now. I'll get onto that after #4496. As you can see in the "WIP" branch it's far from a simple yarn add webpack@4.

You all rock!

It looks like Webpack 4 is included in 6.1.1-canary.3 :tada:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sospedra picture sospedra  路  3Comments

rauchg picture rauchg  路  3Comments

havefive picture havefive  路  3Comments

knipferrc picture knipferrc  路  3Comments

ghost picture ghost  路  3Comments