【发布时间】:2012-04-28 20:56:32
【问题描述】:
我安装了包SASS 和SCSS。 SCSS 提供语法高亮,而 SASS 提供我需要的 scss 构建系统。我的问题是,如果构建设置为自动,如果我按 ctrl+b,它不会构建 scss 文件,所以我必须总是返回并重新选择该选项。有没有办法让构建系统成为 scss 的自动构建系统?
【问题讨论】:
标签: build system sass sublimetext2
我安装了包SASS 和SCSS。 SCSS 提供语法高亮,而 SASS 提供我需要的 scss 构建系统。我的问题是,如果构建设置为自动,如果我按 ctrl+b,它不会构建 scss 文件,所以我必须总是返回并重新选择该选项。有没有办法让构建系统成为 scss 的自动构建系统?
【问题讨论】:
标签: build system sass sublimetext2
使用构建系统进行设置并按 F7 启动: http://readthedocs.org/docs/sublime-text-unofficial-documentation/en/latest/file_processing/build_systems.html?highlight=build 了解有关设置的更多信息。
更新答案
复制以下内容:
{
"cmd": ["sass", "--update", "$file:${file_path}/${file_base_name}.css", "--stop-on-error", "--no-cache"],
"selector": "source.sass, source.scss",
"line_regex": "Line ([0-9]+):",
"osx":
{
"path": "/usr/local/bin:$PATH"
},
"windows":
{
"shell": "true"
}
}
在 Sublime Text 中,转到工具 > 构建系统 > 新构建系统 > 粘贴 给它一个名字。宾果游戏。
更简单的方法
Adding Support for near everything.
最简单的方法
当你不需要的时候为什么要DIY。
希望每次保存时都在打开的浏览器中更新网站?
安装 Nodejs。 (win) 从主站点下载的 .msi 运行良好,包括 npm 现在您可以访问“gem”和“npm”包管理器。 现在事情变得容易了,虽然我不妨长篇大论地写出来。
指南针:
宝石更新--系统 宝石安装指南针 // 现在可以使用这个命令来构建一个基于 sass 的项目 指南针创建 myFirstWebsite // ..安装在“/myFirstWebsite”中..
安装 Grunt 客户端(全局标志)
npm install grunt-cli -g
现在可以访问丰富的 Grunt 自动化软件包,即:
npm grunt-contrib-jshint --save-dev
“dev”标记 - 仅适用于您的本地项目(当前和子文件夹) 此外,在 package.json 中列为“devDependency”,这意味着它不会 在发行版/产品版本中包含您的项目
是时候做一些简单的真棒了...... Yeoman
npm install yo -g
安装 yeoman(yo 命令)一堆其他必需品 和 Bower - twitter 对 Node / Gem 等的回应 Bower 负责处理包依赖项。
还有很棒的吗?
// make a new folder. cd into it, and type:
yo webapp
// There are multiple 'generators' you can install with yo.
// webapp is the one most suitable for front-end dev / web app building
// other things you might want before you start.. maybe underscore:
bower install underscore
// adds '_' to the set-up as a dependency
// These commands will brighten your day:
grunt test
// comprehensive testing of app
grunt server
// This part you'll love! Starts server and launches app in browser
// - includes live-refreshing... save a file, and all required builds etc
// are preformed (damn fast) and automatically refreshes browser.
// Yup, 'grunt server' = project-wide equiv to 'compass watch'
grunt
// Build application for deploy. Not only do you get minification and concatenation;
// also optimize all your image files, HTML, compile your CoffeeScript and Compass files,
// if you're using AMD, will pass those modules through r.js so you don't have to.
【讨论】:
{ "keys": ["f7"], "command": "build" }, { "keys": ["ctrl+b"], "command": "build" }。由于我没有更改默认值,只有用户键映射,我认为这是操作系统的公共键。我的猜测是,它是由另一个包添加的。