renderSync

  • This function synchronously compiles a Sass file to CSS. If it succeeds, it returns the result, and if it fails it throws an error.

    ⚠️ Heads up!

    When using the sass-embedded npm package, render is almost always faster than renderSync, due to the overhead of emulating synchronous messaging with worker threads and concurrent compilations being blocked on main thread.

    Example

    const sass = require('sass'); // or require('node-sass');

    const result = sass.renderSync({file: "style.scss"});
    // ...

    Deprecated

    Use compile or compileString instead.

    Parameters

    Returns LegacyResult