My goal is to build @apollo/client to UMD standard so that it can be used to browser extension. I always encounter error messages such as ERROR in ./node_modules/@apollo/client/react/context/ApolloConsumer.js 2:0-31 Module not found: Error: Can't resolve 'react' in ...(excerpted) ERROR in ./node_modules/@apollo/client/core/LocalState.js 3:0-40 Module not found: Error: Can't resolve 'graphql' ...(excerpted) Solution as below: Prequisites: You need to install webpack, webpack-cli, and copy-webpack-plugin. I use webpack v5.72.1, webpack-cli v4.9.2 and copy-webpack-plugin
read more