mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Precompile main stylesheet from each theme
This commit is contained in:
@@ -19,10 +19,16 @@ module.exports = (grunt) ->
|
||||
path.resolve('static')
|
||||
path.resolve('vendor')
|
||||
]
|
||||
themeMains = []
|
||||
for theme in configuration
|
||||
# TODO Use AtomPackage class once it runs outside of an Atom context
|
||||
themePath = path.resolve('node_modules', theme, 'stylesheets')
|
||||
importPaths.unshift(themePath) if grunt.file.isDir(themePath)
|
||||
themePath = path.resolve('node_modules', theme)
|
||||
stylesheetsDir = path.join(themePath, 'stylesheets')
|
||||
{main} = grunt.file.readJSON(path.join(themePath, 'package.json'))
|
||||
main ?= 'index.less'
|
||||
mainPath = path.join(themePath, main)
|
||||
themeMains.push(mainPath) if grunt.file.isFile(mainPath)
|
||||
importPaths.unshift(stylesheetsDir) if grunt.file.isDir(stylesheetsDir)
|
||||
|
||||
grunt.log.writeln("Building LESS cache for #{configuration.join(', ').yellow}")
|
||||
lessCache = new LessCache
|
||||
@@ -33,3 +39,7 @@ module.exports = (grunt) ->
|
||||
for file in @filesSrc
|
||||
grunt.log.writeln("File #{file.cyan} created in cache.")
|
||||
lessCache.readFileSync(file)
|
||||
|
||||
for file in themeMains
|
||||
grunt.log.writeln("File #{file.cyan} created in cache.")
|
||||
lessCache.readFileSync(file)
|
||||
|
||||
Reference in New Issue
Block a user