1.0.0 • Published 9 years ago

utf8ize-sourcemaps v1.0.0

Weekly downloads
14
License
MIT
Repository
github
Last release
9 years ago

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.