Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const touch = require('touch');
const mkdirp = require('mkdirp');
const browserify = require('browserify');
const envify = require('envify/custom');
const uglify = require('uglify-js');
const strStream = require('string-to-stream');
const splitPkg = require('@splitsoftware/splitio/package');
const splitSource = require.resolve('@splitsoftware/splitio/lib/browser.js');
const bundlesDir = path.resolve(path.join(process.cwd(), `splitio`));
const debugBundlePath = path.resolve(path.join(bundlesDir, `split-${splitPkg.version}.js`));
const productionBundlePath = path.resolve(path.join(bundlesDir, `split-${splitPkg.version}.min.js`));
function minify(bundlePath, customUglifySetting) {
return uglify.minify(bundlePath, Object.assign({
compress: {
sequences : true,
properties : true,
dead_code : true,
drop_debugger : true,
unsafe : false,
unsafe_comps : false,
conditionals : true,
comparisons : true,
evaluate : true,
booleans : true,
loops : true,
unused : true,