Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

broccoli-eyeglass

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-eyeglass

Sass compiler for Broccoli with Eyeglass Integration

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37
decreased by-80.93%
Maintainers
1
Weekly downloads
 
Created
Source

broccoli-eyeglass

broccoli-eyeglass is a broccoli plugin that compiles .scss and .sass files with libsass and uses eyeglass for project and sass module support.

Installation

npm install --save-dev broccoli-eyeglass

Usage

In your Brocfile.js:

var compileSass = require('broccoli-eyeglass');

var outputDirectory = "dist";
var options = {
  cssDir: "assets/css",
  fullException: false
}
var outputTree = compileSass(inputTrees, options);
  • inputTrees: An array of trees that act as the include paths for libsass. If you have a single tree, pass [tree]. All sass files in these trees that are not prefixed with an underscore (a.k.a. a partial), will be compiled into a single output directory. Use the node-sass includePaths option to make other directories available for import without compiling them to css. Note that eyeglass will make sure that all your eyeglass-compatible sass modules can be imported.

  • options: Except for the options that are specific to this plugin. All the rest are passed through eyeglass and then to node-sass.

Note: that the following node-sass options are managed by this plugin and must not be provided: file, data, outFile

Options

The following options are specific to this plugin:

  • cssDir - Required. The directory where CSS files should be written relative to the build output directory.

  • fullException - When set to true, instead of generating a build error, the css output file will be written such that it displays a compilation failure in the browser. This is useful during development but should not be used for production builds. (Not yet implemented)

  • verbose - When true, console logging will occur for each css file that is built along with timing information.

  • optionsGenerator - Function that accepts four arguments:

    • sassFile - The sass file being compiled.
    • cssFile - The place where broccoli-eyeglass plans to write the cssFile relative to the build output directory.
    • options - The compilation options that will be passed to eyeglass and then to node-sass. This is a copy of plugin's options and so it can be modified or augmented.
    • compilationCallback - This callback accepts a css filename and options to use for compilation. This callback can be invoked 0 or more times. Each time it is invoked, the sass file will be compiled to the provided css file name (relative to the output directory) and the options provided.

    In this way a sass file can be skipped or permuted during your build process by passing different options. Examples where this is useful include A/B testing or localization specific output. Note: if you invoke the callback more than once, you should change the output filename to avoid overwriting previous invocations' output.

Keywords

FAQs

Package last updated on 11 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc