utf8ize-sourcemaps

UTF8-ize your sourcemaps

Usage no npm install needed!

<script type="module">
  import utf8izeSourcemaps from 'https://cdn.skypack.dev/utf8ize-sourcemaps';
</script>

README

utf8ize-sourcemaps

UTF8-ize your sourcemaps

Build Status NPM version Dependency Status License

DESCRIPTION

utf8ize-sourcemaps provides a function and a command, both appends charset=utf-8 to SourceMap comment.

MOTIVATION

Sourcemaps have mojibake problems. Unicode characters are broken in sourcemaps with Chrome.

To fix this, we need to add charset=utf-8 to our sourcemaps.

API

var utf8izedCode = utf8ize(originalCode)

var utf8ize = require('utf8ize-sourcemaps');
var originalCode = fs.readFileSync('path/to/code-with-sourcemap-comment.js', 'utf8');
// utf8ize
var utf8izedCode = utf8ize(originalCode);

COMMAND LINE USAGE EXAMPLE

browserify main.js --debug | utf8ize-sourcemaps > bundle.js 

INSTALL

via npm

Install locally,

$ npm install --save-dev utf8ize-sourcemaps

and/or globally.

$ npm install -g utf8ize-sourcemaps

AUTHOR

LICENSE

Licensed under the MIT license.