如何让波旁威士忌与Roots

时间:2016-09-27 15:30:57

标签: coffeescript bourbon neat

所以我正在尝试使用Roots静态网站生成器,我有一段时间让它通过app.coffee文件导入Bourbon-neat。

我的app.coffee看起来像这样:

js_pipeline  = require 'js-pipeline'
css_pipeline = require 'css-pipeline'
browserify   = require 'roots-browserify'
sass         = require 'node-sass'

module.exports =
  ignores: ['readme.md', '**/layout.*', '**/_*', '.gitignore', 'ship.*conf']

  extensions: [
    browserify(files: 'assets/js/main.coffee', out: 'js/build.js')
    js_pipeline(files: 'assets/js/*.coffee'),
    css_pipeline(files: 'assets/css/*.scss')
  ]

  'coffee-script':
    sourcemap: true

  jade:
    pretty: true

  sass:
    // includePaths: require('bourbon-neat').includePaths
    // includePaths: [require('bourbon-neat').includePaths]
    includePaths: ['node_modules/bourbon-neat/app/assets/stylesheets/']

评论includePaths是我尝试过的其他内容。我已经阅读了提到需要通过require('bourbone-neat').includePaths的波旁文字文档,但它似乎没有用。

我在.scss文件中尝试@import "neat"时遇到的错误是:

Error: File to import not found or unreadable: neat

注意:根目录似乎没有标记。

1 个答案:

答案 0 :(得分:0)

对于其他任何人来说,我都能让这个工作。这是我的app.coffee

js_pipeline  = require 'js-pipeline'
css_pipeline = require 'css-pipeline'
browserify   = require 'roots-browserify'

module.exports =
  debug:true
  ignores: ['readme.md', '**/layout.*', '**/_*', '.gitignore', 'ship.*conf']

  extensions: [
    browserify(files: 'assets/js/main.coffee', out: 'js/build.js')
    js_pipeline(files: 'assets/js/*.coffee')
    css_pipeline(files: 'assets/css/*.scss')
  ]

  'coffee-script':
    sourcemap: true

  jade:
    pretty: true

  scss:
      includePaths: require('bourbon-neat').includePaths