Webpack 5 - quiet warnings originating from node_modules?

874 views Asked by At

I'm using webpack 5.44.0 and webpack-dev-server 3.11.2, and a custom webpack/babel config in my react project. I'm importing esri-leaflet-geocoder into my project. When developing with webpack dev server, I get this warning:

WARNING in ./node_modules/esri-leaflet-geocoder/node_modules/esri-leaflet/src/EsriLeaflet.js 2:0-51
Should not import the named export 'version' (reexported as 'VERSION') from default-exporting module (only default export is available soon)
 @ ./node_modules/esri-leaflet-geocoder/dist/esri-leaflet-geocoder-debug.js 5:102-125
 @ ./src/index.tsx 34:0-31

I read the question Error: Should not import the named export 'version' (imported as 'version'), which seems to be the most closely related. But in my case, ther issue is buried within the external module of esri-leaflet-geocoder, so I really don't have any control over the code in it.

Is it possible to tell webpack dev server to ignore this specific kind of warning, or any warning that originates from within the node_modules folder? I want to keep warnings from within my own code, but not print warnings if they're caused by code in a node_module. Is this kind of granular control over warnings possible in webpack? How can I ignore this warning?

0

There are 0 answers