2

How is it possible to include paths to Bourbon (installed via npm) in a package.json of a node project?

All the examples I've seen are via grunt, etc:

var bourbon = require('node-bourbon');
bourbon.includePaths // Array of Bourbon paths

Anyone know how to do this so that the following will work in SASS files?

@import 'bourbon';

Current SASS compilation is a step in our build that looks like this:

"scripts": {
    // Need to import bourbon npm package as sass before /scss directory
    "sass": "node-sass -o build/css/ scss/"
}
j_d
  • 2,818
  • 9
  • 50
  • 91
  • What exactly are you trying to do? You want to set paths? Or access them from SASS? Or what? – Steve Bennett Jan 07 '16 at 09:01
  • @SteveBennett I've edited the post for clarity. Basically I need to import the bourbon npm package at the top of my compiled scss build file. If you look at the [node-sass docs](https://github.com/sass/node-sass) there seems to be an `--include-path` method, but it's not working for me. – j_d Jan 07 '16 at 18:30

1 Answers1

1

There are several ways to do that, but as far as i know it's not possible to set the include path in the package.json.

If you are using the Sass CLI you can run sass -I [path to bourbon] input.scss:output.css

Using node-sass would be:

"scripts": {
    "sass": "node-sass --include-path node_modules/bourbon/app/assets/stylesheets -o build/css/ scss/"
}
L. Catallo
  • 563
  • 4
  • 11
  • I've edited the post for clarity. Basically I need to import the bourbon npm package at the top of my compiled scss build file. If you look at the [node-sass docs](https://github.com/sass/node-sass) there seems to be an `--include-path` method, but it's not working for me. – j_d Jan 07 '16 at 18:31
  • `--include-path` works for me. Edited the answer to include the code – L. Catallo Jan 07 '16 at 21:06