public function setProductionMode($isProduction) { if ($isProduction) { $this->compiler->setLineNumberStyle(0); $this->compiler->setFormatter(CompressedOutput::class); } }
/** * @param LeafoCompiler $compiler * @return LeafoScssProcessor */ public function setCompiler(LeafoCompiler $compiler) { $compiler->setImportPaths($this->importPaths); $compiler->setFormatter($this->getFormatter()); $compiler->setLineNumberStyle($this->getLineNumberStyle()); $this->compiler = $compiler; return $this; }
public static function compileFile(string $file, array $paths, string $formatter, bool $lineComments) : array { $location = static::resolveFile($file, $paths); $compiler = new Compiler(); $compiler->setImportPaths(\dirname($location)); $compiler->addImportPath(function (string $path) use($paths) { return static::resolveFile($path, $paths); }); $compiler->setFormatter($formatter); if ($lineComments) { $compiler->setLineNumberStyle(Compiler::LINE_COMMENTS); } $css = $compiler->compile(\file_get_contents($location), $location); return [$css, $compiler->getParsedFiles()]; }