File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -197,5 +197,15 @@ module.exports = {
197197 new HotModuleReplacementPlugin ( ) ,
198198
199199 new NamedModulesPlugin ( )
200- ]
200+ ] ,
201+
202+ // Some libraries import Node modules but don't use them in the browser.
203+ // Tell Webpack to provide empty mocks for them so importing them works.
204+ node : {
205+ dgram : 'empty' ,
206+ fs : 'empty' ,
207+ net : 'empty' ,
208+ tls : 'empty' ,
209+ child_process : 'empty' ,
210+ } ,
201211} ;
Original file line number Diff line number Diff line change @@ -242,5 +242,14 @@ module.exports = {
242242 // Don't precache sourcemaps (they're large) and build asset manifest:
243243 staticFileGlobsIgnorePatterns : [ / \. m a p $ / , / a s s e t - m a n i f e s t \. j s o n $ / ]
244244 } )
245- ]
245+ ] ,
246+ // Some libraries import Node modules but don't use them in the browser.
247+ // Tell Webpack to provide empty mocks for them so importing them works.
248+ node : {
249+ dgram : 'empty' ,
250+ fs : 'empty' ,
251+ net : 'empty' ,
252+ tls : 'empty' ,
253+ child_process : 'empty' ,
254+ } ,
246255} ;
You can’t perform that action at this time.
0 commit comments