grunt-external-sourcemap
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "grunt-external-sourcemap", | ||
"version": "0.1.2", | ||
"version": "0.1.4", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "coffee-script": { |
{ | ||
"name": "grunt-external-sourcemap", | ||
"description": "Strips sourcemaps from a js file and links the original file to a newly created external source map", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Matt Blair", |
# grunt-external-sourcemap | ||
> Strips sourcemaps from a js file and links the original file to a newly created external source map | ||
> Extracts sourcemaps from a js file and links the original file to an external source map file | ||
@@ -38,3 +38,3 @@ ## Getting Started | ||
#### Default Options | ||
Given a set of files with inline source maps, the source maps are stripped out into their own files and the original `.js` files are updated to point at the newly created, separate source map file. | ||
Given a set of files with inline source maps, the source maps are extracted into their own files and the original `.js` files are updated to point at the new external source map file. | ||
@@ -51,2 +51,16 @@ ```js | ||
#### Custom Options | ||
You set a flag, `removeSourcesContent`, which will remove the sourcesContent field from the extracted source map. | ||
```js | ||
grunt.initConfig({ | ||
external_sourcemap: { | ||
options: { 'removeSourcesContent': true } | ||
files: { | ||
'public/build': ['src/build/output1.js', 'src/build/output2.js'], | ||
}, | ||
}, | ||
}) | ||
``` | ||
## Installation | ||
@@ -53,0 +67,0 @@ |
@@ -14,4 +14,4 @@ 'use strict'; | ||
test.ok(grunt.file.exists('test/fixtures/external_sourcemap.js'), "test .js file has not been generated"); | ||
test.ok(grunt.file.exists('test/expected/external_sourcemap.js'), "generated source map js is not present"); | ||
test.ok(grunt.file.exists('test/expected/external_sourcemap.js.map'), "generated source map is not present"); | ||
test.ok(grunt.file.exists('test/expected/default_options/external_sourcemap.js'), "generated source map js is not present"); | ||
test.ok(grunt.file.exists('test/expected/default_options/external_sourcemap.js.map'), "generated source map is not present"); | ||
@@ -24,7 +24,20 @@ test.done(); | ||
test.ok(grunt.file.exists('test/fixtures/external_sourcemap.js'), "test .js file has not been generated"); | ||
test.ok(grunt.file.exists('test/expected/external_sourcemap.js'), "generated source map js is not present"); | ||
test.ok(grunt.file.exists('test/expected/external_sourcemap.js.map'), "generated source map is not present"); | ||
test.ok(grunt.file.exists('test/expected/cwd_options/external_sourcemap.js'), "generated source map js is not present"); | ||
test.ok(grunt.file.exists('test/expected/cwd_options/external_sourcemap.js.map'), "generated source map is not present"); | ||
test.done(); | ||
}, | ||
strip_source: function(test) { | ||
test.expect(4); | ||
test.ok(grunt.file.exists('test/fixtures/external_sourcemap.js'), "test .js file has not been generated"); | ||
test.ok(grunt.file.exists('test/expected/strip_source/external_sourcemap.js'), "generated source map js is not present"); | ||
test.ok(grunt.file.exists('test/expected/strip_source/external_sourcemap.js.map'), "generated source map is not present"); | ||
var source = grunt.file.read('test/expected/strip_source/external_sourcemap.js.map') | ||
var map = JSON.parse(source) | ||
test.ok(map.sourcesContent === undefined, "sourcesContent was not removed") | ||
test.done(); | ||
} | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
32603
749
71