question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal of Webpack 4 and WebpackServe integration

See original GitHub issue

Is this a bug report?

No.

Proposal

I just recently solved react-error-overlay and react-dev-utils/launchEditor integration with webpack 4 and webpack-serve.

I created hot-client-plugin.

Would you like me to configure it in the next branch?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
maximandrewscommented, Nov 20, 2018

@iansu I’m proposing in the next probably major release (next branch) of react-scripts to integrate webpack 4 with webpack-serve (Koa.js).

Currently, the next branch uses webpack 4, but still relies on webpack-dev-server (Express.js).

It is not so easy to integrate webpack-serve because it relies on webpack-hot-client which do not allows integration of react-error-overlay properly. At the moment their offered Error Overlay solution IMHO is a hack which works with errors.

I tried to offer my help to webpack-serve guys, but after I shared my excitement with react-error-overlay they became resistant and aggressive. They even deleted my last comment which stated it is not cool to have “reputational wars” with others just because they propose better solutions.

Anyway, the only option is to completely disable webpack-hot-client by setting hotClient option to false in a webpack-serve config and to use custom solution as they offered in their reply to me. Therefore, I created hot-client-plugin to address this issue.

To integrate hot-client-plugin into create-react-app there are needed only a few steps:

  1. remove react-dev-utils/webpackHotDevClient from the entry array. A modified version will be injected automatically;
  2. remove HotModuleReplacementPlugin from plugins array. It will be injected automatically;
  3. add HotClientPlugin to plugins array;
  4. replace webpack-dev-server package with webpack-serve in package.json file by issuing command npm remove webpack-dev-server and then npm i webpack-serve in react-scripts folder;
  5. rename webpackDevServer.config.js to webpackServe.config.js and adapt it to use with webpack-serve with the hotClient option set to false to disable webpack-hot-client completely.

It is pretty much all the details about my proposal and changes I’m offering to implement.

What do you think?

0reactions
maximandrewscommented, Oct 4, 2018

@tbassetto This was my first thought, but when I opened webpack-serve README.md I found this on the top: This repository has been archived by the owner. It is now read-only.

If you are looking to use React with KOA and/or backend, you can use my package fullstack-scripts. Just give me a notice and I will create proper README.md file quickly. I’m going to create a proper starter kit in the nearest future, for those who are seeking React, Redux, Router, Koa or a third party backend or any of mentioned tech combination.

Checkout live fullstack-scripts use case here

Read more comments on GitHub >

github_iconTop Results From Across the Web

To v4 from v3 - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
webpack-serve-overlay · Issue #4 - GitHub
@shellscape I'm trying to convey that integrating Error Overlay into webpack-serve will not going to be easy task.
Read more >
Understanding the Modern Web Stack: Webpack - DevServer ...
It can often be tricky and confusing for newcomers to understand how to integrate Typescript into a webpack configuration, particularly if you ...
Read more >
Using Webpack with Spring Boot | Bootify.io
How can we integrate Webpack into our Spring Boot application? Spoiler: in Bootify's Free plan, Spring Boot applications can be initialized ...
Read more >
Starting with Webpack 4 and VueJs — A quick-start tutorial.
I started with a #0CJS (Zero-Config JS) where default modes are used, but once I integrated Vue, I added few basic configurations to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found