Created
August 20, 2014 20:03
-
-
Save CoffeeAndCode/ee624eda11662ab932a9 to your computer and use it in GitHub Desktop.
running Exorcist with Grunt Browserify after bundle creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This will create a readable stream that we can pipe our bundle to Exorcist with | |
var stream = require('stream'); | |
var grunt = require('grunt'); | |
var exorcist = require('exorcist'); | |
var createSourceMap = function(err, src, next) { | |
var mapfile = grunt.template.process('<%= folders.output %>/<%= filenames.js %>.map'); | |
var s = new stream.Readable(); | |
s._read = function noop() {}; | |
s.push(src); | |
s.push(null); | |
s.pipe(exorcist(mapfile).on('finish', function() { | |
next(err, src); | |
})); | |
}; | |
module.exports = { | |
development: { | |
options: { | |
bundleOptions: { | |
debug: true | |
}, | |
postBundleCB: createSourceMap | |
}, | |
dest: 'destination.js', | |
src: 'source.js' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment