How to use the @splitsoftware/splitio/package.version function in @splitsoftware/splitio

To help you get started, we’ve selected a few @splitsoftware/splitio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github splitio / javascript-client / packages / splitio-browser / bin / bundler.js View on Github external
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,