Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack: make it ignore source files that can't be found?

I'm using snabbdom.js and webpack to build a JS front-end app. I have a very simple snabbdom view and webpack config that bundles it up. When I load the bundle in chrome I get all this stuff in the console:

webpack source map warnings

I can set the webpack mode to production which does get rid of these warnings but it also turns off all source maps, so that's not really helpful. I found this other related question that describes how to use a plugin to load them. But I don't want to mess around with configuring a plugin for source maps I don't actually want. Is there a way to tell webpack to just ignore these?

like image 728
Marty Kane Avatar asked Jul 21 '20 19:07

Marty Kane


Video Answer


1 Answers

I read up a bit more on the details of each option in the webpack devtools options and found that adding devtool: 'eval-cheap-source-map', to my webpack config did the trick.

From the docs:

it doesn't have column mappings, it only maps line numbers. It ignores SourceMaps from Loaders and only display transpiled code similar to the eval devtool

like image 185
Marty Kane Avatar answered Sep 19 '22 02:09

Marty Kane