パッケージの詳細

rosid-handler-sass

electerious501MIT8.0.0

Load SASS and transform to CSS, add vendor prefixes and minify

rosid, handler, transform, compile

readme

rosid-handler-sass

Travis Build Status Coverage Status Dependencies Greenkeeper badge

A function that loads a SASS file, transforms it to CSS, adds vendor prefixes and minifies the output.

Install

npm install rosid-handler-sass

Usage

API

const handler = require('rosid-handler-sass')

handler('main.sass').then((data) => {})
handler('main.css', { optimize: true }).then((data) => {})

Rosid

Add the following object to your rosidfile.json, rosidfile.js or routes array. rosid-handler-sass will transform all matching SASS files in your source folder to CSS.

{
  "name"    : "SASS",
  "path"    : "[^_]*.{css,sass}*",
  "handler" : "rosid-handler-sass"
}
/* main.sass */
.class
    color: white;
/* main.css (output) */
.class { color: white; }

Parameters

  • filePath {String} Absolute path to file.
  • opts {?Object} Options.
    • optimize {?Boolean} - Optimize output. Defaults to false.

Returns

  • {Promise<String|Buffer>} The transformed file content.

更新履歴

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[8.0.0] - 2020-11-30

Changed

  • Switched from node-sass to sass (#44, @omBratteng)

[7.0.0] - 2020-03-20

Changed

  • Updated dependencies
  • Only support Node.js 10+
  • Test with Node.js 10 and 12

[6.0.4] - 2019-02-23

Changed

  • Updated tests
  • Updated option handling

[6.0.3] - 2019-02-23

Changed

  • Updated dependencies

[6.0.2] - 2018-08-25

Changed

  • Updated dependencies

[6.0.1] - 2018-07-05

Fixed

  • Missing autoprefixer in dependencies

[6.0.0] - 2018-01-12

Changed

  • Improved JSDoc annotation
  • Removed prepublish script from package.json
  • Only support Node.js 8+

Fixed

  • Assert parameter order in tests

[5.0.2] - 2017-08-08

Changed

  • Ignore yarn.lock and package-lock.json files

[5.0.1] - 2017-07-21

Changed

  • Use async / await

[5.0.0] - 2017-07-19

Added

  • Only support Node.js 7 and 8

Changed

  • Cache array contains glob patterns for Rosid 8.0