0

I have a project based on react-boilerplate.

This seed project keeps server and client code in the same repo.

I want to use socket.io.

So I type:

yarn add socket.io

This adds socket.io to the package.json.

BUT I think this is then used by webpack to attempt to create a bundle.

Which then fails because socket.io is a Node.js module that depends on Node.js things like fs.

How can I stop webpack from attempting to bundle socket.io in this instance?

Aurora0001
  • 13,139
  • 5
  • 50
  • 53
Ben Aston
  • 53,718
  • 65
  • 205
  • 331

1 Answers1

0

Add the library name to the exclude array under internals/config then dllPlugin.defaults.excldue.

Ben Aston
  • 53,718
  • 65
  • 205
  • 331