【问题标题】:Import bootstrap with stylus使用手写笔导入引导程序
【发布时间】:2016-07-14 10:32:00
【问题描述】:

我从boilderplate 开始吃早午餐。现在我想在这里包括bootstrap-styl。我已经用 npm 安装了引导程序,工作正常。现在它位于 node_modules 文件夹中。当我尝试在 *.styl 文件中 @import bootstrap 时出现问题。

failed to locate @import file bootstrap.styl

根据文档,这是我让它工作所需要的:

var bootstrap = require('bootstrap-styl'),
    stylus    = require('stylus');

function compile(str) {
  return stylus(str)
    .use(bootstrap());
}

那么我到底需要在哪里写这个?在我的任何脚本中?我完全不明白这个洞是如何运作的。试着把这段代码放到空的脚本文件里,还是没有结果。

【问题讨论】:

    标签: node.js twitter-bootstrap stylus brunch


    【解决方案1】:

    stylus-brunch 的自述文件确实解决了这个问题 — https://github.com/brunch/stylus-brunch#use-plugin-middleware

    在您的情况下,您希望编辑您的 brunch-config 以拥有:

    config =
      plugins:
        stylus:
          plugins: ['bootstrap-stylus']
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-28
      • 2020-11-20
      • 1970-01-01
      • 1970-01-01
      • 2016-06-19
      • 2022-11-04
      • 2021-12-29
      • 1970-01-01
      相关资源
      最近更新 更多