Sass开发工作流程问题

发布于 2024-10-09 00:22:17 字数 382 浏览 1 评论 0原文

我一直在尝试将 Sass 采用到我的开发工作流程中。我主要从事前端开发,因此我经常更新样式表。经过无休止的搜索,我还没有找到我认为应该是一个简单问题的答案。

我同时使用 Coda 和 Textmate,因此两者的解决方案就足够了。在本地开发时,我打开终端,观看我的 .scss 文件,然后进城。我保存了我的 .scss 文件,它很高兴地更新了我的 .css 文件...然后我留下了一点烦恼,必须手动选择 .css 并将其发布到远程服务器。
这不是世界末日,但必须暂停我通常的开发工作流程来手动上传我不活跃的文件变得很麻烦。在 Coda 中,它不会检测文件何时在 Coda 外部更新,因此不会将其标记为发布。它让我发疯。我只需要一种方法来保存 .scss 文件并将 .css 文件轻松/自动上传到远程服务器。任何帮助将不胜感激!

I've been trying to adopt Sass into my development workflow. I do primarily front-end development and as such, I am updating stylesheets quite frequently. After endless searching, I have yet to find the answer to what I feel should be a simple question.

I use both Coda and Textmate, so a solution for either would suffice. When developing locally, I open the terminal, get my .scss file watched, then go to town. I save my .scss file, it happily updates my .css file... and then I'm left with the slight annoyance of having to manually select the .css and publish it to the remote server.
Its not the end of the world but having to pause my usual dev workflow to manually upload a file I'm not actively in is becoming a nuisance. In Coda, it doesn't detect when a file has been updated outside of Coda, so it isn't marked for publishing. Its driving me crazy. I just need a way to save the .scss file and have the .css file easily/automatically uploaded to the remote server. Any help would be greatly appreciated!

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

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

发布评论

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

评论(4

枯叶蝶 2024-10-16 00:22:17

使用 Sass 的典型方式是在使用 Sass 的同时在本地计算机上进行设计,完成后仅将 CSS(也可能还有 Sass)上传到服务器。另一种选择是在服务器上运行 sass --watch ,以便编译上传的 Sass 文件。

The typical way Sass is used is to design on your local computer while using Sass, and to only upload the CSS (and probably the Sass as well) to the server once you're finished. Another alternative would be to run sass --watch on the server so that it compiles the uploaded Sass files.

乱了心跳 2024-10-16 00:22:17

我有一个 rake 任务在这种情况下调用 rsync 。每次仍然需要运行,但因为它使用 rsync,所以仅移动更改的文件。现在,在阅读本文时,我有一个想法,不应该在某个地方有“rsync watch”,而且确实似乎有: http://code.google.com/p/lsyncd/

I have had a rake task that calls rsync for this kind of cases. That still needs to be run each time but because it uses rsync only the changed files are moved. Now, while reading this I got an idea that shouldn't there be 'rsync watch' somewhere and indeed there seems to be: http://code.google.com/p/lsyncd/

悲凉≈ 2024-10-16 00:22:17

这是我刚刚读到的一个有趣的方法,将指南针安装到一个小型的本地 ruby​​ 环境中,受到 python virtualenv 的启发:
http://rhodesmill.org/brandon/2011/adding-compass/

YMMV (我自己什至没有尝试过)。

Here's an interesting approach I just read about, installing compass into a small local ruby env, inspired by python virtualenv:
http://rhodesmill.org/brandon/2011/adding-compass/

YMMV (I haven't even tried this myself).

甜心小果奶 2024-10-16 00:22:17

Sublime SFTP/FTP 插件 可以在 SCSS 更新时监控并自动上传 .css 输出文件编译器。

  1. 将您的项目目录映射到服务器
  2. 通过浏览远程检查它是否正确工作
  3. 右键单击您的.css输出文件,然后选择“监视文件(在外部保存上上传)”
  4. 在Sublime中保持文件选项卡打开以确保它保持监视/上传。

如需额外积分,请查看 Browsersync 或 LiveReload。

The Sublime SFTP/FTP Plugin can monitor and auto-upload the .css output file whenever it's updated by the SCSS compiler.

  1. Map your project directory to your server
  2. Check it's woking correctly by browsing remote
  3. Right click on your .css output file, and choose 'Monitor File (Upload on External Save)'
  4. Keep the file's tab open in Sublime to ensure it stays monitored/uploaded.

For extra points, have a look at Browsersync or LiveReload.

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