【发布时间】:2017-08-24 12:13:10
【问题描述】:
我有一个自动生成的 .sass-cache 文件夹。试图弄清楚如何不让它产生它。更清楚地说,我不想要 .sass-cache 文件夹。
我尝试了几种方法,但似乎无法阻止它生成。
这里尝试了几种方法:
- noCache:假或真
- config.rb 文件:asset_cache_buster = :none
- config.rb 文件:cache = false
这是我的手表正在做的事情:
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
files: ['assets/js/*.js'],
tasks: ['concat', 'uglify', 'copy', 'clean'],
options: {
spawn: false
}
},
scss: {
files: ['assets/scss/*.scss'],
tasks: ['compass', 'cssmin'],
}
},
稍后,这是 Compass 正在做的事情以及我的任务的 sn-p:
compass: {
development: {
options: {
config: './config.rb',
sassDir: 'assets/scss',
cssDir: 'assets/css'
}
}
},
clean:{
build: {
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('default', ['watch']);
grunt.registerTask(
'build',
'Compiles all the assets and copies the files to the build directory.',
['less', 'compass', 'cssmin', 'concat', 'uglify', 'copy', 'clean']
);
};
这是我在我的配置中尝试的。
if File.file?( './.nosasscache' )
asset_cache_buster = :none
cache = false # Uncomment to disable cache.
end
【问题讨论】:
标签: caching sass gruntjs compass