codymikol / karma-webpack

Karma webpack Middleware
MIT License
830 stars 222 forks source link

Does not correctly indicate the path to the file #321

Closed vasivas closed 6 years ago

vasivas commented 6 years ago
// index.ts

console.log('is src/index.ts');
nonExistenFunction();

is src/index.ts context.js:2509 index.ts:2 Uncaught ReferenceError: nonExistenFunction is not defined index.ts:2 at Object../index.ts (index.ts:2) at webpack_require (index.ts:2) at Object../index.spec.ts (index.ts:2) at webpack_require (index.ts:2) at index.ts:2 at index.ts:2

The sourcemap has applied to the error path and therefore the path is specified in the browser console as index.ts. It's Ok! But the console.log path is specified as context.js. It's Bad!

How to make the console.log path in the browser display index.ts?

Minimal configuration of the project https://github.com/vasivas/karma-webpack-demo