【问题标题】:Referencing .styl of a node_module in Brunch在早午餐中引用节点模块的 .style
【发布时间】:2013-03-15 02:34:06
【问题描述】:

我有一个与卓别林一起吃早午餐的应用程序。我想使用 Twitter Bootstrap,但由于它是用 LESS 编写的,我更愿意切换到手写笔版本。幸运的是,那里有一个 bootstrap-stylus node_module。 所以我通过npm install bootstrap-stylus 安装它。但是,我如何引用模块内的手写笔文件呢?正在做

@import 'bootstrap-stylus'

不起作用。也不附加 /lib/bootstrap 路径。

我的dependenciespackage.json 文件中有"bootstrap-stylus": ">= 0.2",但仍然不行。有任何想法吗?谢谢。

【问题讨论】:

  • 应该类似于@import node_modules/bootstrap-stylus
  • 谢谢,没错。

标签: node.js twitter-bootstrap stylus brunch chaplinjs


【解决方案1】:

npm 安装到你的 node_modules 文件夹中,你可以从那里@import stylus 文件。

在我的测试中起作用的是:

@import 'node_modules/bootstrap-stylus/lib/bootstrap.styl'

【讨论】:

    【解决方案2】:

    node_modules 用于 node.js。早午餐适用于前端/html5。你不能把它们组合起来那么简单。

    您需要手动将内容复制到appvendor 目录。

    【讨论】:

    • 不,可以像@generalhenry 所说的那样使用正确的@import 命令,还可以通过brunch 配置文件集成javascript,告诉它也要查看node_modules 目录内
    • 保罗·米勒。您可以通过 npm 使用“前端”依赖项,例如:font-awesome、jquery、slick-carousel 等,并且 node_modules 文件夹将是他们的家
    猜你喜欢
    • 1970-01-01
    • 2015-12-16
    • 2013-11-03
    • 2019-01-04
    • 2012-06-19
    • 2018-08-27
    • 1970-01-01
    • 2016-01-19
    • 1970-01-01
    相关资源
    最近更新 更多