-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
48 lines (48 loc) · 4.04 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
"name": "combine-source-map",
"version": "0.3.0",
"description": "Add source maps of multiple files, offset them and then combine them into one source map",
"main": "index.js",
"scripts": {
"test": "tap test/*.js"
},
"repository": {
"type": "git",
"url": "git://github.com/thlorenz/combine-source-map.git"
},
"homepage": "https://github.com/thlorenz/combine-source-map",
"dependencies": {
"inline-source-map": "~0.3.0",
"convert-source-map": "~0.3.0",
"source-map": "~0.1.31"
},
"devDependencies": {
"tap": "~0.4.3"
},
"keywords": [
"source",
"map",
"sourcemap",
"bundle",
"combine",
"cat",
"sourceMappingUrl",
"browserify"
],
"author": {
"name": "Thorsten Lorenz",
"email": "thlorenz@gmx.de",
"url": "http://thlorenz.com"
},
"license": "MIT",
"engine": {
"node": ">=0.6"
},
"readme": "# combine-source-map [![build status](https://secure.travis-ci.org/thlorenz/combine-source-map.png)](http://travis-ci.org/thlorenz/combine-source-map)\n\nAdd source maps of multiple files, offset them and then combine them into one source map.\n\n```js\nvar convert = require('convert-source-map');\nvar combine = require('combine-source-map');\n\nvar fooComment = '//# sourceMappingURL=data:application/json;base64,eyJ2Z [..] pzJylcbiJdfQ==';\nvar barComment = '//# sourceMappingURL=data:application/json;base64,eyJ2Z [..] VjaycpXG4iXX0=';\n\nvar fooFile = {\n source: '(function() {\\n\\n console.log(require(\\'./bar.js\\'));\\n\\n}).call(this);\\n' + '\\n' + fooComment\n , sourceFile: 'foo.js'\n};\nvar barFile = {\n source: '(function() {\\n\\n console.log(alert(\\'alerts suck\\'));\\n\\n}).call(this);\\n' + '\\n' + barComment\n , sourceFile: 'bar.js'\n};\n\nvar offset = { line: 2 };\nvar base64 = combine\n .create('bundle.js')\n .addFile(fooFile, offset)\n .addFile(barFile, { line: offset.line + 8 })\n .base64();\n\nvar sm = convert.fromBase64(base64).toObject();\nconsole.log(sm);\n```\n\n```\n{ version: 3,\n file: 'bundle.js',\n sources: [ 'foo.coffee', 'bar.coffee' ],\n names: [],\n mappings: ';;;AAAA;CAAA;CAAA,CAAA,CAAA,IAAO,GAAK;CAAZ;;;;;ACAA;CAAA;CAAA,CAAA,CAAA,IAAO,GAAK;CAAZ',\n sourcesContent:\n [ 'console.log(require \\'./bar.js\\')\\n',\n 'console.log(alert \\'alerts suck\\')\\n' ] }\n```\n\n## Installation\n\n npm install combine-source-map\n\n## API\n\n### create()\n\n```\n/**\n * @name create\n * @function\n * @param file {String} optional name of the generated file\n * @param sourceRoot { String} optional sourceRoot of the map to be generated\n * @return {Object} Combiner instance to which source maps can be added and later combined\n */\n```\n\n### Combiner.prototype.addFile(opts, offset)\n\n```\n/**\n * Adds map to underlying source map.\n * If source contains a source map comment that has the source of the original file inlined it will offset these\n * mappings and include them.\n * If no source map comment is found or it has no source inlined, mappings for the file will be generated and included\n * \n * @name addMap\n * @function\n * @param opts {Object} { sourceFile: {String}, source: {String} }\n * @param offset {Object} { line: {Number}, column: {Number} }\n */\n```\n\n### Combiner.prototype.base64()\n\n```\n/**\n* @name base64\n* @function\n* @return {String} base64 encoded combined source map\n*/\n```\n\n### Combiner.prototype.comment()\n\n```\n/**\n * @name comment\n * @function\n * @return {String} base64 encoded sourceMappingUrl comment of the combined source map\n */\n```\n\n### removeComments(src)\n\n```\n/**\n * @name removeComments\n * @function\n * @param src \n * @return {String} src with all sourceMappingUrl comments removed\n */\n```\n\n## Example \n\nRead and run the [more elaborate example](https://github.com/thlorenz/combine-source-map/blob/master/example/two-files.js) \nin order to get a better idea how things work.\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/thlorenz/combine-source-map/issues"
},
"_id": "combine-source-map@0.3.0",
"_from": "combine-source-map@~0.3.0"
}