karma-sourcemap-loader
    Overview
    Documentation
    Tutorials
    Insights
    Code
    Dependencies
    Contributors
    Jobs

karma-sourcemap-loader

Karma plugin that locates and loads existing javascript source map files.

0.3.7  •  Updated 3 years ago  •  by Gabriele Genta  •  MIT License

Preprocessor that locates and loads existing source maps.

Why

When you use karma not in isolation but as part of a build process (e.g. using grunt or gulp) it is often the case that the compilation/transpilation is done on a previous step of the process and not handled by karma preprocessors. In these cases source maps don’t get loaded by karma and you lose the advantages of having them.

How it works

This plug-in supports both inline and external source maps.

Inline source maps are located by searching “sourceMappingURL=” inside the javascript file, both plain text and base64-encoded maps are supported.

External source maps are located by appending “.map” to the javascript file name. So if for example you have Hello.js, the preprocessor will try to load source map from Hello.js.map.

Installation

Just add karma-sourcemap-loader as a devDependency in your package.json.

{
  "devDependencies": {
    "karma-sourcemap-loader": "~0.3"
  }
}

Or issue the following command:

npm install karma-sourcemap-loader --save-dev

Configuration

The code below shows a sample configuration of the preprocessor.

// karma.conf.js
module.exports = function(config) {
  config.set({
    preprocessors: {
      '**/*.js': ['sourcemap']
    }
  });
};

Popularity

Weekly Downloads
305.4K
Stars
72

Maintenance

Development

Last ver 4 years ago
Created 6 years ago
Last commit 4 years ago
18 days between commits

Technology

Node version: 5.1.0
0 unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

11 contributors
Gabriele Genta
Maintainer, 25 commits, 13 merges
Simen Bekkhus
3 commits, 3 PRs
Works at folio-as
Klaas Cuvelier
3 commits, 1 PRs
Works at showpad
Harry Schmidt
3 commits
Fahad Ibnay Heylaal
1 commits, 1 PRs
Judson
1 commits, 1 PRs
Works at OpenTable

Dependencies

Tags

karma-plugin
karma-preprocessor
source-maps
javascript
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.