diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index a88409f2d05..cfc971e609e 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -203,5 +203,12 @@ module.exports = { // makes the discovery automatic so you don't have to restart. // See https://github.com/facebookincubator/create-react-app/issues/186 new WatchMissingNodeModulesPlugin(paths.appNodeModules) - ] + ], + // Some libraries import Node modules but don't use them in the browser. + // Tell Webpack to provide empty mocks for them so importing them works. + node: { + fs: 'empty', + net: 'empty', + tls: 'empty' + } }; diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 552ded48551..ae5ef218fe5 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -238,5 +238,12 @@ module.exports = { }), // Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`. new ExtractTextPlugin('static/css/[name].[contenthash:8].css') - ] + ], + // Some libraries import Node modules but don't use them in the browser. + // Tell Webpack to provide empty mocks for them so importing them works. + node: { + fs: 'empty', + net: 'empty', + tls: 'empty' + } };