Compile a LESS source file. Minifies the output in release mode.
353086
def compile_less(input_file, output_file):
    
    from .modules import less

    if not isinstance(input_file, str):
        raise RuntimeError('LESS compiler takes only a single input file.')

    return {
        'dependencies_fn': less.less_dependencies,
        'compiler_fn': less.less_compile,
        'input': input_file,
        'output': output_file,
        'kwargs': {},
    }
896455
function compress(file) {
  var ext = path.extname(file),
    res,
    source,
    result;

  switch (ext) {
    case '.js':
      console.log('uglifying js file ' + file);

      res = ngAnnotate(String(fs.readFileSync(file, 'utf8')), {
        add: true
      });
      result = UglifyJS.minify(res.src, hookConfig.uglifyJsOptions);
      fs.writeFileSync(file, result.code, 'utf8'); // overwrite the original unminified file
      break;

    case '.css':
      console.log('minifying css file ' + file);

      source = fs.readFileSync(file, 'utf8');
      result = cssMinifier.minify(source);
      fs.writeFileSync(file, result.styles, 'utf8'); // overwrite the original unminified file
      break;

    default:
      console.log('encountered a ' + ext + ' file, not compressing it');
      break;
  }
}
1101143
function (next) {

									minify(
										outputCommonsJsFile,
										_.extend({optimize: true},uglifyOptions),
										function(err){
											if ( err ){
												return next(err);
											}
											return next();
										}
									);

								}
453684
function lessCached(filename, options) {
  if (options.cache === 'dynamic') {
    throw new Error('Dynamic cache still needs implimenting');
    if (cache[filename]) {
      return cache[filename].then(function (result) {
        
      });
    } else {
      return cache[filename] = lessInternal(filename, options);
    }
  } else if (options.cache) {
    if (cache[filename]) return cache[filename];
    else return cache[filename] = lessInternal(filename, options);
  } else {
    return lessInternal(filename, options);
  }
}
899167
def minify(compiled):
    
    compiled = compiled.strip()
    if compiled:
        out = []
        for line in compiled.splitlines():
            line = line.split("#", 1)[0].rstrip()
            if line:
                ind = 0
                while line.startswith(" "):
                    line = line[1:]
                    ind += 1
                internal_assert(ind % tabideal == 0, "invalid indentation in", line)
                out.append(" " * (ind // tabideal) + line)
        compiled = "\n".join(out) + "\n"
    return compiled
181301
function compileSingleFile (filePath, isDebug, options)
{
    var outputPath = "./" + path.dirname(filePath).replace(/(^|\/)assets\/js/, "$1public/js");
    var uglifyOptions = {};

    gulpUtil.log(gulpUtil.colors.blue("Uglify"), pathHelper.makeRelative(filePath), " -> ", pathHelper.makeRelative(outputPath) + "/" + path.basename(filePath));

    if (options.lint)
    {
        jsHintHelper.lintFile(filePath);
    }

    if (isDebug)
    {
        uglifyOptions.compress = false;
        uglifyOptions.preserveComments = "all";
    }

    return gulp.src(filePath)
        .pipe(plumber())
        .pipe(uglify(uglifyOptions))
        .pipe(gulp.dest(outputPath));
}
77963
function minifyTemplate(file) {
  try {
    let minifiedFile = htmlMinifier.minify(file, {
      collapseWhitespace: true,
      caseSensitive: true,
      removeComments: true
    });
    return minifiedFile;
  } catch (err) {
    console.log(err);
  }
}
846515
function bundleRelease(minify) {
  var bundler = browserify({
    entries: ['./src/' + entryFileName],
    standalone: standaloneName,
    debug: !minify
  });

  if(minify) {
    bundler = bundler.plugin(collapse);
  }

  var stream = bundler.bundle()
    .on('error', logError);

  if(!minify) {
    stream = stream.pipe(exorcist('./dist/' + bundleFileName + '.map'));
  }

  stream = stream.pipe(source(bundleFileName))
    .pipe(buffer())
    .pipe(derequire())
    .pipe(strip());

  if(minify) {
    return stream.pipe(rename({extname: '.min.js'}))
      .pipe(uglify())
      .pipe(gulp.dest('./dist/'));
  } else {
    return stream.pipe(gulp.dest('./dist/'));
  }
}
914545
def less_to_css(style_less):
    
    with fileOpen(tempfile, 'w') as f:
            f.write(style_less)
    os.chdir(package_dir)
    style_css = lesscpy.compile(tempfile)
    style_css += '\n\n'
    return style_css
445590
async function compile() {
  let codes;
  const paths = await glob(['./es/**/*.less', './lib/**/*.less'], { absolute: true });

  codes = await Promise.all(paths.map(path => fs.readFile(path, 'utf-8')));
  codes = await compileLess(codes, paths);
  codes = await compilePostcss(codes, paths);
  codes = await compileCsso(codes);

  await dest(codes, paths);
}
1226391
function initCssLESS() {
  // Options for less-middleware.
  var opt = {
    debug: false,
    render: {
      compress: false
    }
  };
  var sm;
  if (build.engine.less.map.enabled === true) {
    // Less-middleware passes opt.render data to the less.render function.
    opt.render.sourceMap = sm = {
      sourceMapBasepath: build.sourceDir,
      sourceMapRootpath: '/'
    };
    if (build.engine.less.map.inline === true) {
      // BUG: External map files are still created, even when inline is enabled.
      sm.sourceMapFileInline = true;
      sm.sourceMapLessInline = true;
      sm.sourceMapMapInline = true;
      sm.outputSourceFiles = true;
    } else {
      // HACK: Specifying sourceMapFilename here causes less to put the same
      // sourceMappingURL in every css file, so instead we use a special token
      // and fix the situation during postprocess.css.
      sm.sourceMapFilename = initCssLESS.SOURCEMAP_FILENAME_TOKEN;
      opt.postprocess = {
        css: postprocessCss
      };
    }
  }
  app.use(lessMw(build.sourceDir, opt));
}
1259707
function compileLess() {
  console.log(chalk.cyan(`compiling ${chalk.magenta('src/less/hierplane.less')}`));
  cp.execSync(`${which.sync('lessc')} --clean-css --autoprefix="last 2 versions" src/less/hierplane.less dist/static/hierplane.min.css`);
  console.log(chalk.green(`wrote ${chalk.magenta('dist/static/hierplane.min.css')}`));
}
267912
function define (File, utils) {
  const { debug, error, strong } = utils.cnsl;

  return class LESSFile extends File {
    /**
     * Constructor
     * @param {String} id
     * @param {String} filepath
     * @param {Object} options
     *  - {Object} caches
     *  - {Object} fileExtensions
     *  - {Function} fileFactory
     *  - {Object} globalAliases
     *  - {Array} npmModulepaths
     *  - {Object} pluginOptions
     *  - {Object} runtimeOptions
     */
    constructor (id, filepath, options) {
      super(id, filepath, options);

      this.workflows.writeable = WORKFLOW_WRITEABLE;
    }

    /**
     * Compile file contents
     * @param {Object} buildOptions
     *  - {Boolean} batch
     *  - {Boolean} bootstrap
     *  - {Boolean} boilerplate
     *  - {Boolean} browser
     *  - {Boolean} bundle
     *  - {Boolean} compress
     *  - {Array} ignoredFiles
     *  - {Boolean} helpers
     *  - {Boolean} watchOnly
     * @param {Function} fn(err)
     */
    compile (buildOptions, fn) {
      const options = Object.assign(
        this.hasMaps ? { sourceMap: {} } : {},
        this.options.pluginOptions.less || {}
      );

      less.render(this.content, options, (err, result) => {
        if (err) {
          if (!this.options.runtimeOptions.watch) return fn(err);
          error(err, 4, false);
        }

        const { css: content, map } = result;

        this.setContent(content);
        if (map) this.setMap(map);
        debug(`compile: ${strong(this.relpath)}`, 4);
        fn();
      });
    }
  };
}
650734
def minify_js(input_files, output_file):
    
    from .modules import minify, utils

    if not isinstance(input_files, (list, tuple)):
        raise RuntimeError('JS minifier takes a list of input files.')

    return {
        'dependencies_fn': utils.no_dependencies,
        'compiler_fn': minify.minify_js,
        'input': input_files,
        'output': output_file,
        'kwargs': {},
    }
340584
private static WyilFile compile(List<Path.Entry<WhileyFile>> sources, Path.Entry<WyilFile> target) throws IOException {
		// Read target WyilFile. This may have already been compiled in a previous run
		// and, in such case, we are invalidating some or all of the existing file.
		WyilFile wyil = target.read();
		// Parse all modules
		for(int i=0;i!=sources.size();++i) {
			Path.Entry<WhileyFile> source = sources.get(i);
			WhileyFileParser wyp = new WhileyFileParser(wyil, source.read());
			// FIXME: what to do with module added to heap? The problem is that this might
			// be replaced a module, for example.
			wyil.getModule().putUnit(wyp.read());
		}
		//
		return wyil;
	}
866510
def less_display():
    
    # here's some magic. We want the nice paging from 'less', so we write
    # the output to a file and use subprocess to run 'less' on the file.
    # But the file might have sensitive data, so open it in 0600 mode.
    _, filename = tempfile.mkstemp()
    mode = stat.S_IRUSR | stat.S_IWUSR
    outfile = None
    outfile = os.fdopen(os.open(filename, os.O_WRONLY | os.O_CREAT, mode), "wb")
    try:
        yield SmartBuffer(outfile)
        outfile.flush()
        subprocess.call(["less", "-FXR", filename])
    finally:
        if outfile is not None:
            outfile.close()
        if os.path.exists(filename):
            os.unlink(filename)
1014942
def lessc(responsive=False):
    
    local('lessc {0}/static/css/bootstrap.less'
          ' {0}/static/css/bootstrap.css'.format(settings.PROJECT_NAME))
    if responsive:
        local('lessc {0}/static/css/responsive.less'
              ' {0}/static/css/bootstrap-responsive.css'.format(
                  settings.PROJECT_NAME))