Add fallback less cache during build

This commit is contained in:
Kevin Sawicki 2016-01-27 16:16:38 -08:00
parent 85f4bba1da
commit f2c5cd6fda
2 changed files with 7 additions and 1 deletions

View File

@ -121,6 +121,8 @@ module.exports = (grunt) ->
ext: '.css'
prebuildLessConfig =
options:
cachePath: path.join(homeDir, '.atom', 'compile-cache', 'prebuild-less')
src: [
'static/**/*.less'
]

View File

@ -15,6 +15,8 @@ module.exports = (grunt) ->
lessCache = new LessCache
cacheDir: temp.mkdirSync('atom-less-cache')
fallbackDir: grunt.config.get('prebuild-less.options.cachePath')
syncCaches: true
resourcePath: path.resolve('.')
bootstrapCss = lessCache.readFileSync(bootstrapLessPath)
@ -88,6 +90,8 @@ module.exports = (grunt) ->
grunt.verbose.writeln("Building Less cache for #{configuration.join(', ').yellow}")
lessCache = new LessCache
cacheDir: directory
fallbackDir: grunt.config.get('prebuild-less.options.cachePath')
syncCaches: true
resourcePath: path.resolve('.')
importPaths: importPaths
@ -112,4 +116,4 @@ module.exports = (grunt) ->
cacheMisses += lessCache.stats.misses
cacheHits += lessCache.stats.hits
grunt.log.ok(cacheMisses + ' Less files compiled, ' + cacheHits + ' files reused')
grunt.log.ok("#{cacheMisses} files compiled, #{cacheHits} files reused")