utf8ize-sourcemaps

1.0.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i utf8ize-sourcemaps

Weekly Downloads

5

Version

1.0.0

License

MIT

Last publish

Collaborators

  • twada