Created by: jameslnewell
formatWebpackMessages
is neat! I'm using it outside of create-react-app
. However, it's a little too eager in stripping stack traces from messages.
I'm using the static-react-render-webpack-plugin which evaluates the outputted webpack bundle. When evaluating the outputted webpack bundle throws (in the user's code), the user needs the stack trace to debug what went wrong. formatWebpackMessages
is stripping all stack traces making that difficult.
This PR excludes stack traces where the source path contains webpack:
. I've created a demo of the regexp working which shows stack traces being stripped for babel-loader
but not static-react-render-webpack-plugin
.
Example stack trace
static-react-render-webpack-plugin: Error rendering page "scripts/components/compare/couples.js": ReferenceError: Foobar is not defined
at Couples (webpack:///./components/compare/couples/index.jsx?:37:5)
at eval (webpack:///../~/react/lib/ReactCompositeComponent.js?:305:16)
at measureLifeCyclePerf (webpack:///../~/react/lib/ReactCompositeComponent.js?:74:12)
at ReactCompositeComponentMixin._constructComponentWithoutOwner (webpack:///../~/react/lib/ReactCompositeComponent.js?:304:14)
at ReactCompositeComponentMixin._constructComponent (webpack:///../~/react/lib/ReactCompositeComponent.js?:279:21)
at ReactCompositeComponentMixin.mountComponent (webpack:///../~/react/lib/ReactCompositeComponent.js?:187:21)
at Object.ReactReconciler.mountComponent (webpack:///../~/react/lib/ReactReconciler.js?:47:35)
at ReactDOMComponent.ReactMultiChild.Mixin.mountChildren (webpack:///../~/react/lib/ReactMultiChild.js?:240:44)
at ReactDOMComponent.Mixin._createContentMarkup (webpack:///../~/react/lib/ReactDOMComponent.js?:661:32)
at ReactDOMComponent.Mixin.mountComponent (webpack:///../~/react/lib/ReactDOMComponent.js?:528:29)