Twitter bootstrap 从grunt contrib sass切换到grunt sass后,编译时间相同。两者所用的时间与我使用Ruby时相同
我听说过要开快车。我从Ruby换成了Grunt。但无论我使用Ruby、grunt contrib sass、grunt sass哪种编译方法,速度都是一样的。编译引导SCS需要15秒 grunt.js: config.rb:Twitter bootstrap 从grunt contrib sass切换到grunt sass后,编译时间相同。两者所用的时间与我使用Ruby时相同,twitter-bootstrap,gruntjs,grunt-contrib-sass,Twitter Bootstrap,Gruntjs,Grunt Contrib Sass,我听说过要开快车。我从Ruby换成了Grunt。但无论我使用Ruby、grunt contrib sass、grunt sass哪种编译方法,速度都是一样的。编译引导SCS需要15秒 grunt.js: config.rb: 通过配置,您仍在使用Compass编译SCSS文件,grunt sass任务既没有配置也没有运行。由于Compass是基于Ruby的,并且仍在使用Ruby SASS预处理器,因此编译时间没有任何改进 是SASS编译器的C/C++实现,它完全消除了Ruby。在评论中提到Com
通过配置,您仍在使用Compass编译SCSS文件,grunt sass任务既没有配置也没有运行。由于Compass是基于Ruby的,并且仍在使用Ruby SASS预处理器,因此编译时间没有任何改进 是SASS编译器的C/C++实现,它完全消除了Ruby。在评论中提到Compass有很多Ruby依赖性,因此在可预见的将来不会移植到Libsass。因此,如果您严重依赖Compass混音器和函数,则必须坚持使用Ruby预处理器 如果您可以取消Compass,则可以通过以下配置使用grunt sass:
module.exports = function(grunt) {
grunt.initConfig({
watch: {
src: {
files: ['public_html/sass/*.scss'],
tasks: ['sass:dev']
},
options: {
livereload: true
}
},
sass: {
options: {
sourceMap: true,
outputStyle: 'expanded'
},
dev: {
files: [{
expand: true,
src: ['public_html/sass/**/*.{scss,sass}'],
dest: 'public_html/css/'
}]
}
}
});
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
}
有关可用选项的更多信息,请查看
# Require any additional compass plugins here.
require 'bootstrap-sass'
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "public_html/css"
sass_dir = "public_html/sass"
images_dir = "public_html/images"
javascripts_dir = "public_html/js"
fonts_dir = "public_html/fonts"
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
# output_style = :expanded
environment = :development
# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
line_comments = true
sourcemap = true
sass_options = {:sourcemap => true}
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
module.exports = function(grunt) {
grunt.initConfig({
watch: {
src: {
files: ['public_html/sass/*.scss'],
tasks: ['sass:dev']
},
options: {
livereload: true
}
},
sass: {
options: {
sourceMap: true,
outputStyle: 'expanded'
},
dev: {
files: [{
expand: true,
src: ['public_html/sass/**/*.{scss,sass}'],
dest: 'public_html/css/'
}]
}
}
});
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
}