def command_devserver_js(uglifyjs=None):
    uglifyjs = uglifyjs or 'external/uglifyjs/bin/uglifyjs'

    def compactor(dev_filename, rel_filename):
        # Use compactor to generate release version.
        echo('Compacting: %s -> %s' % (dev_filename, rel_filename))
        rc = call('node %s -o %s %s' % (uglifyjs, rel_filename, dev_filename), shell=True)
        if rc != 0:
            error('Failed to run uglifyjs, specify location with --uglifyjs')
            exit(1)

    versions_yaml = os.path.join(TURBULENZ_LOCAL, 'config', 'js_versions.yaml')
    dev_path = os.path.join(TURBULENZ_LOCAL, 'public', 'development')
    rel_path = os.path.join(TURBULENZ_LOCAL, 'public', 'release')
    ext = 'js'

    mkdir(os.path.join(rel_path, ext))

    try:
        compact(dev_path, rel_path, versions_yaml, ext, compactor)
    except __HOLE__ as e:
        error('Failed to save js version details: %s' % str(e))
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/local_server.py/command_devserver_js