Strips minErr error messages from your build.
npm install --save-dev minerr-strip
This is essentially how the plugin is used in the gulp-minerr-strip package.
/** * @param {MinErrBuilderOptions} options */functionminerrStrip(options){'use strict';try{varminErrBuilder=newMinErrBuilder(options);}catch(error){thrownewPluginError(PLUGIN_NAME,error);}returnthrough.obj(functiontransform(file,enc,done){var_this=this;if(file.isNull()){this.push(file);returndone();}functionprocessFileContents(contents){try{returnminErrBuilder.processModule(contents);}catch(error){_this.emit('error',newPluginError(PLUGIN_NAME,error));}}if(file.isBuffer()){file.contents=newBuffer(processFileContents(file.contents));this.push(file);returndone();}if(!file.isStream()){// Can there be another type?this.emit('error',newPluginError(PLUGIN_NAME,'File type was not buffer, stream or null and is therefor not supported'));returndone();}file.contents.pipe(es.wait(function(err,data){file.contents=es.readArray([processFileContents(data)]);_this.push(file);done();}));},functionflush(done){try{minErrBuilder.flushErrorConfig();}catch(error){this.emit('error',newPluginError(PLUGIN_NAME,error));}returndone();});}Pull requests are welcome! Remember to keep the following rules in mind:
- All features or bug fixes must be documented by one or more specs. We use Jasmine.
- Submissions must pass JSHint. Run
gulp lintto check this. - Instead of complex inheritance hierarchies, we prefer simple objects. We use prototypical inheritance only when absolutely necessary.
- We love functions and closures and, whenever possible, prefer them over objects.