0

Is it possible for Webpack to report the file name causing an error at runtime

In other words, it will report the an error thrown is coming from common.js bundle, which makes it hard to find the source. Is it possible to run webpack and have it NOT bundle anything just for testing or maybe have it report the original file name?

regards

Sean

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142
born2net
  • 24,129
  • 22
  • 65
  • 104

1 Answers1

1

If you are referring to source maps then this may help.

stackoverflow question

webpack devtool

If you are running webpack from the command line you can run it in 'development mode' mode by including the -d flag like so > webpack -d

Community
  • 1
  • 1
Craig McKenna
  • 268
  • 3
  • 10
  • I am using the web-dev-server, any flags I can use? – born2net Jan 31 '16 at 22:03
  • but even with the dev server it still bundles, right? – born2net Jan 31 '16 at 22:13
  • you can use `devtool` like `devtool: 'eval-souce-map'` in your `webpack.config` There are other devtool options though. See the webpack devtool link in my answer above. – Craig McKenna Jan 31 '16 at 22:19
  • Yes it still bundles. Source maps are not actual code but (as I understand it) a string representation of your original source. Perhaps this will help: [Introduction to JavaScript Source Maps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/) I have not read it though so I cannot say for sure. – Craig McKenna Jan 31 '16 at 22:30
  • not source maps, very familiar with them... just the file name that had the exceptions instead of common_bundle... – born2net Feb 02 '16 at 19:05