Does Karma support source map files?

前端 未结 2 867
逝去的感伤
逝去的感伤 2021-02-20 03:51

Is it possible to configure Karma to use source map files for stacktraces? I see that there are a few issues on GitHub which appear to have been closed? I can\'t however find an

相关标签:
2条回答
  • 2021-02-20 04:24

    In your karma.config.js file add

    config.set({
    files: [{
            pattern: '**/*.js.map',
            included: false
          },
    ...
    });
    

    This has worked for me, and files are now served by karma.

    0 讨论(0)
  • 2021-02-20 04:24

    You need a preprocessor to look at source maps in karma: have a look at karma-sourcemap-loader to preprocess your data and locate the source map files. A limitation of the library is that the source maps must be in the same folder as the js files, with the same name - but different extension of course.

    0 讨论(0)
提交回复
热议问题