项目作者: bahmutov

项目描述 :
Rebuilds node-sass but only if needed
高级语言: JavaScript
项目地址: git://github.com/bahmutov/rebuild-node-sass.git
创建时间: 2017-06-26T19:14:41Z
项目社区:https://github.com/bahmutov/rebuild-node-sass

开源协议:

下载


rebuild-node-sass

Rebuilds node-sass but only if needed

NPM

Build status
semantic-release

Use

  1. npm install --save-dev rebuild-node-sass node-sass

Then before build (when node-sass is probably used), call rebuild-node-sass
to make sure it is ready

  1. {
  2. "scripts": {
  3. "prebuild": "rebuild-node-sass",
  4. "build": "..."
  5. }
  6. }

Testing

To execute in a different environment, for example when working on Mac, we
can install Mac Sass binary npm install and then switch to Docker

  1. docker run -v $PWD:/src -w /src -it node /bin/bash

which produces the following output (abridged)

  1. root@0d0cd593e320:/src# ./rebuild.sh
  2. npm info it worked if it ends with ok
  3. npm info using npm@5.0.0
  4. npm info using node@v8.0.0
  5. npm info ok
  6. /src/node_modules/node-sass/lib/binding.js:15
  7. throw new Error(errors.missingBinary());
  8. ...
  9. Binary found at /src/node_modules/node-sass/vendor/linux-x64-57/binding.node
  10. Testing binary
  11. Binary is fine
  12. node-sass@4.5.3 /src/node_modules/node-sass