← 全部工具

inline-source-map-comment

热度 65 更新于 开发与构建

Create an inline source map comment from a source map

npmauto-collected

安装

npm
npm install -g inline-source-map-comment

通过 npm 安装。

inline-source-map-comment

Create an inline source map comment from a source map object or string

var inlineSourceMapComment = require('inline-source-map-comment');

var fixture = {
  version:3,
  file: 'output.js.map',
  sources: ['input.js'],
  names: [],
  mappings: 'AAAA'
};

inlineSourceMapComment(fixture);
//=> "//# sourceMappingURL=data:application/json;base64,eyJ2ZXJza ..."

Installation

Package managers

#### npm

npm install inline-source-map-comment

#### bower

bower install inline-source-map-comment

#### Duo

var inlineSourceMapComment = require('shinnn/inline-source-map-comment');

Standalone

Download the script file directly.

API

inlineSourceMapComment(sourceMap [, options])

sourceMap: String or Object options: Object Return: String

It returns a line comment of base64-encoded source map.

Argument can be an object of source map or a JSON string.