GithubHelp home page GithubHelp logo

spencer-leopold / sasster Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 228 KB

Node module to compile sass using Libsass. Has a watch option that will only recompile files that import the current file.

JavaScript 99.69% CSS 0.31%

sasster's Introduction

travis-ci status Dependency Status Coverage Status

Sasster

Compiles SCSS/SASS to CSS using libsass. The main difference between it and others is that there is a watch option that will only re-compile files that need to be, rather than re-compiling everything after every change.

Setup

Configuration can either be added directly into your package.json, or you can create a sasster.config.js file in order to use custom includePaths (i.e. Bourbon, Neat).

Install

With npm do:

npm install -D sasster

Usage

Usage: sasster <source> <dest> --cwd [str] --imagePath [str] --outputStyle [str] --sourceMap [bool] -c [str] -w [bool]

Options:

    --cwd           Path to the Current Working Directory, useful when using
                    globs in the <source> option

    --imagePath     Path to your image directory

    --outputStyle   Change the generated CSS output, default is nested

    --sourceMap     Boolean, whether or not to generate source maps

    --config, -c    Path to a custom configuration file.

    --watch, -w     A bundle name to watch. You can repeat 
                    this option for each bundle you want to
                    watch.

Example

using standalone

  $ sasster **/*.scss dist/css --cwd=src/scss --imagePath=img --sourceMap=true --outputStyle=compressed -w

Configuration using package.json

...
  "sasster": {
    "cwd": "src/scss"
    "src": "**/*.scss",
    "dest": "dist/css"
    "imagePath": "img",
    "outputStyle": "nested",
    "sourceMap": true,
    "chokidar": {
      "usePolling": true
    }
  }
...
  "scripts": {
    "clean": "rimraf dist/css/*",
    "watch:styles": "sasster -w",
    "build:styles": "npm run clean && sasster --sourceMap=false --outputStyle=compressed",
    "dev": "npm run watch:styles",
    "prod": "npm run build:styles"
  }

Example

using the above package.json

  $ npm run dev

Configuration using sasster.config.js

(in your project's root)

var neat = require('node-neat');

module.exports = {
  cwd: 'src/scss'
  src: '**/*.scss',
  dest: 'dist/css'
  imagePath: 'img',
  outputStyle: 'nested',
  sourceMap: true,
  includePaths: neat.includePaths,
  chokidar: {
    usePolling: true
  }
}

sasster's People

Contributors

spencer-leopold avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.