Normalize source map paths for cross-platform usage
A Grunt task. A spiritual successor to source-map-path-normalizer and source-map-path-normalizify.
It turns out it's 2016 and some tools still can't get the Windows paths in source maps right - the backslashes are left intact and the effect looks horrible in the DevTools.
This task is a remedy for that situation - it normalizes the paths wrt the current working directory (or some other one - it's configurable). Set up once and forget.
npm install grunt-sourcemap-normalize --save-dev
grunt.loadNpmTasks('grunt-sourcemap-normalize');
grunt.initConfig({
sourceMapNormalize: ['source.js.map'],
});
The following option is supported:
Type: String
Default value: process.cwd()
By default the paths are normalized wrt the current working directory. Setting this option changes that.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2016 Rafał Ruciński. Licensed under the MIT license.