Grunt:当修改了依赖的@import目标时,如何编译父依赖项?

时间:2013-09-10 23:47:17

标签: gruntjs stylus codekit

我正在尝试将我的Stylus编译过程从CodeKit迁移到Grunt。

以下是文件的结构:

/styl
  - page-1.styl
  - page-2.styl
  - …
  - /components
    - header.styl
    - footer.styl
    - module-1.styl
    - …

目录根目录中的每个page-x.styl都有@import个语句,用于从./styl/components子目录中提取模块样式表。

例如,page-1.styl看起来像这样:

 @import 'components/header'
 @import 'components/module-1'

 // Other styles here
 .foo { … }
 …

当我修改components/header.styl时,CodeKit会巧妙地选择@import关系,并相应地编译page-1.styl(以及导入相同修改文件的其他文件),甚至获得排除奖励积分components/header.styl本身也来自编译。

不出所料,仅使用grunt-contrib-watch + grunt-contrib-stylus就不会发生这种情况。有没有人设法让这个通过Grunt工作?

0 个答案:

没有答案