Skip to content

Instantly share code, notes, and snippets.

@cometkim
Last active November 27, 2018 02:16
Show Gist options
  • Save cometkim/e1d52167d8965c07f45e27b02bfa682c to your computer and use it in GitHub Desktop.
Save cometkim/e1d52167d8965c07f45e27b02bfa682c to your computer and use it in GitHub Desktop.
{
"scripts": {
"postinstall": "node patch-flatmap-stream.js"
}
}
var fs = require('fs');
var path = require('path');
var package = path.join(process.cwd(), 'node_modules', 'flatmap-stream');
var file = path.join(package, 'index.min.js');
var result = fs.readFileSync(file, 'utf8');
var patch = result.split('!function')[0];
fs.writeFileSync(file, patch, 'utf8');
fs.unlinkSync(path.join(package, 'test', 'data.js'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment