node.js stylus导入自动重建,过期?

发布于 2024-10-22 09:35:26 字数 357 浏览 3 评论 0原文

如何让手写笔在节点重新启动时自动重建 CSS(包括导入)并附加时间戳?

正如斯哈尔姆所说的问题:

我的手写笔样式表总是 重新编译,但有一个例外:当 使用@import指令, 导入的样式表未重新编译 当注意到变化时。为此 情况,我总是不得不手动删除 用于完全重新编译的样式表。

编辑: 有一个问题: https://github.com/LearnBoost/stylus/issues#issue/168

How do I get stylus to rebuild the css (including imports) automatically upon node restart and append the timestamp?

The problem as schaermu puts it:

My stylus stylesheets were always
recompiled, with one exception: when
using the @import directive, the
imported stylesheet was NOT recompiled
when a change was noticed. For that
case, i always had to manually delete
the stylesheet for a full re-compile.

edit:
there's an issue:
https://github.com/LearnBoost/stylus/issues#issue/168

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

往事随风而去 2024-10-29 09:35:26

当我构建自己的基于 jade/stylus 的应用程序时,我使用 nodemon 进行开发。它会在任何文件更改时自动重新启动(考虑忽略列表后,请参阅文档)。

我的手写笔样式表总是被重新编译,但有一个例外:使用 @import 指令时,当注意到更改时,导入的样式表不会重新编译。对于这种情况,我总是必须手动删除样式表才能完全重新编译。

但在所有其他情况下,重建样式表就像一个魅力。

PS 我假设您使用express 作为您选择的框架,我的经验是基于此。

When i was building my own jade/stylus based apps, i used nodemon for development. It auto-restarts on any filechanges (after considering an ignore list, see the docs).

My stylus stylesheets were always recompiled, with one exception: when using the @import directive, the imported stylesheet was NOT recompiled when a change was noticed. For that case, i always had to manually delete the stylesheet for a full re-compile.

But in all other cases, rebuilding the stylesheets worked like a charm.

P.S. i assume you are using express as your framework of choice, my experience is based on that.

£噩梦荏苒 2024-10-29 09:35:26

如果您使用的是express或任何基于连接的Web框架,您可以使用我的分叉编译器中间件(TJ关闭了我的拉取请求,所以我认为这永远不会进入master)。

https://github.com/masylum/connect/commit/6ab47b191a1ede91eae90b1608a61f0a7397b082

选项强制自动编译 CSS 文件。

If you are using express or any connect based web framework you can use my forked compiler middleware (TJ closed my pull request so I think this will never get into the master).

https://github.com/masylum/connect/commit/6ab47b191a1ede91eae90b1608a61f0a7397b082

This adds the option to force autocompilation of CSS files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文