编译SCSS(指南针)+刷新浏览器的最快方法? [英] Fastest way to compile SCSS (Compass) + refresh the browser?

查看:109
本文介绍了编译SCSS(指南针)+刷新浏览器的最快方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您只是想知道什么是最快的方式来编译SCSS和刷新浏览器?我目前正在使用LiveReload,但是有时似乎有点慢,可能需要1-3秒。似乎还不多,但是我感觉我正在失去适当的编码速度。

Just wondering what in your opinion is the fastest way to have your SCSS compiled and browser refreshed? I'm currently using LiveReload, but it seems to be a bit slow sometimes, it can take from 1-3sec. It doesn't seem much, but I feel like I'm losing my proper coding pace.

你们使用什么? CodeKit会更快吗?还是Sublime LiveReload插件(不是实际的应用程序)?还是我应该放弃指南针并使用其他东西?任何建议将不胜感激。

What do you guys use? would CodeKit be faster? Or maybe Sublime LiveReload plugin (not the actual app)? Or maybe I should give up Compass and use something else? Any suggestions would be appreciated.

PS。我在OS X上

PS. I'm on OS X

推荐答案

我使用此堆栈:




  • gruntjs

  • grunt-sass (使用 libsass 通过 node-sass 代替ruby sass)

  • grunt-watch-contrib

  • I use this stack:

    • gruntjs
    • grunt-sass (uses libsass via node-sass instead of ruby sass)
    • grunt-watch-contrib
      • Sass indented syntax is not supported.
      • Compass is not supported

      但这是更快的x100xxx ...!

      此处了解更多:

      http://benfrain.com/lightning-fast-sass -与libsass-node-sass-and-grunt-sass /

      要在页面上启用实时重新加载,请在结束正文标记之前添加脚本标记:

      To enable live reload on your page, add a script tag before your closing body tag:

      <script src="//localhost:35729/livereload.js"></script>
      

      这是 Gruntfile.js 的示例:

      module.exports = function(grunt) {
        grunt.initConfig({
          pkg: grunt.file.readJSON("package.json"),
          sass: {
            dist: {
              options: {
                outputStyle: "nested"
              },
              files: {
                "dist/css/app.css": "src/scss/app.scss"
              }
            }
          },
          watch: {
            options: {
              livereload: true
            },
            grunt: {
              files: ["Gruntfile.coffee"]
            },
            sass: {
              files: "src/scss/app.scss",
              tasks: ["sass"]
            }
          }
        });
        grunt.loadNpmTasks("grunt-sass");
        grunt.loadNpmTasks("grunt-contrib-watch");
        grunt.registerTask("build", ["sass"]);
        grunt.registerTask("default", ["build", "watch"]);
      };
      

      这篇关于编译SCSS(指南针)+刷新浏览器的最快方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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