Sublime SFTP - 保存sass文件时上传编译的css [英] Sublime SFTP - Upload compiled css when sass file saved

查看:381
本文介绍了Sublime SFTP - 保存sass文件时上传编译的css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Sublime中开发html / css。我使用 sass 编写我的css,并使用Sublime的构建系统在文件保存时生成css文件。它还配置为使用 SFTP 插件保存时上传。



我的问题是生成的css文件不会被上传,因为这不是我直接保存的文件。我试图看看是否有一个方法SFTP插件上传所有已修改的本地文件,但它似乎不支持这一点。



有没有什么我可以做到这一点?

解决方案

我会把我的解决方案,在这,因为我做,并希望尽可能接近一个完全基于ST的工作流。如果您使用SF的SFTP包,则可以选择监视外部保存的文件。





总结


  1. 打开目标文件,命令调色板。输入 SFTP:监视文件(在外部保存时上传)


  2. 我喜欢Sass: sass --watch app.scss:app.css


  3. 目标文件打开,否则S​​FTP监视器似乎停止。


b $ b

注意:您也可以通过右键单击要监控的文件并选择...来启用文件监控。




I'm developing html/css in Sublime. I'm writing my css with sass and using Sublime's build system to generate the css file on file save. It's also configured to upload on save using the SFTP plugin.

My problem is that the generated css file doesn't get uploaded as that isn't the file I've directly saved. I've tried to see if there is a way for the SFTP plugin to upload all files that have been modified locally, but it doesn't seem to support that.

Is there anything I can do to achieve this?

解决方案

I'll throw my solution into the mix, just in case anyone stumbles on this as I did and wants to stick as close to a solely ST-based workflow as possible. If you're using the SFTP package for ST, there is an option to monitor files for external saves.

Unfortunately, using the ST build system to compile my SASS somehow slipped by SFTP. SASS CLI's watch utility, however, triggers the upload just fine. Once set, presuming the target file remains open, SFTP will upload it after each build.

To recap,

  1. Open target file, followed by the command palette. Enter SFTP: Monitor File (Upload on External Save)

  2. Start whatever CLI watch/build utility you prefer, for me, Sass: sass --watch app.scss:app.css

  3. Leave target file open, otherwise the SFTP monitor seems to cease.

Enjoy!

NOTE: You can also enable file monitoring from the sidebar by right clicking on the file you wish to monitor and selecting...

这篇关于Sublime SFTP - 保存sass文件时上传编译的css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆