我有一個自動生成的.sass-cache文件夾。試圖弄清楚如何不讓它產生它。更清楚的是,我不需要.sass-cache文件夾。如何防止Compass使用Grunt輸出.sass-cache文件夾
我已經嘗試了幾種方法,但似乎無法阻止它生成。
這裏有一對夫婦試圖辦法:
- NOCACHE:asset_cache_buster =:無 與
- config.rb文件:高速緩存=假
以下是我的手錶在做什麼:
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: {
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
它仍然沒有發生。我甚至在終端內嘗試過,乾淨的羅盤,它仍然會生成.sass-cache文件夾。我也嘗試添加指南針乾淨作爲一項任務,但似乎沒有工作。我顯然做得不對。我也確定我終止了終端任務並開始備份,以確保更改生效。 – JonnyBorg