Skip to content

Make server compatible with scssphp 2.0.1 #13

@jmroelofs

Description

@jmroelofs

In order to use server with scssphp 2.0.1 I had to add one line to omit the utf-bom (because that was placed after the "/* compiled by scssphp 2.0.1 on Mon, ...") and one line to set the importPaths (because that has to be implicitely set now).

My code is now:

<?php
require_once './vendor/autoload.php';

use ScssPhp\ScssPhp\Compiler;
use ScssPhp\ScssPhp\OutputStyle;
use ScssPhp\Server\Server;

$scssDirectory = 'scss';

$scssCompiler = new Compiler();
$scssCompiler->setCharset(false);
$scssCompiler->setOutputStyle(OutputStyle::COMPRESSED);
$scssCompiler->setImportPaths($scssDirectory);

new Server($scssDirectory, null, $scssCompiler)
    ->serve();

One could add defaults for those two in the __construct of Server.php to make it work nicely again with scssphp 2.0.1 and real easy to use.

I'm willing to make a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions