How to use the sass.cli_pkg_main_0_ function in sass

To help you get started, we’ve selected a few sass examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bazelbuild / rules_sass / sass / sass_wrapper.js View on Github external
  runWorkerLoop(args => sass.cli_pkg_main_0_(args));
  // Note: intentionally don't process.exit() here, because runWorkerLoop
github bazelbuild / rules_sass / sass / sass_wrapper.js View on Github external
runWorkerLoop(args => sass.cli_pkg_main_0_(args));
  // Note: intentionally don't process.exit() here, because runWorkerLoop
  // is waiting for async callbacks from node.
} else {
  debug('Running a single build...');
  if (args.length === 0) throw new Error('Not enough arguments');
  if (args.length !== 1) {
    throw new Error('Expected one argument: path to flagfile');
  }

  // Bazel worker protocol expects the only arg to be @.
  // When we are running a single build, we remove the @ prefix and read the list 
  // of actual arguments line by line.
  const configFile = args[0].replace(/^@+/, '');
  const configContent = fs.readFileSync(configFile, 'utf8').trim();
  sass.cli_pkg_main_0_(configContent.split('\n'));
}

process.exitCode = 0;