Add addPathToCache helper for apm to warm using

This commit is contained in:
Kevin Sawicki 2014-10-08 14:44:39 -07:00 committed by Kevin Sawicki
parent d1f3d7d51e
commit f0cffcbd84

View File

@ -45,3 +45,11 @@ module.exports =
writable: false
value: requireCoffeeScript
})
addPathToCache: (filePath) ->
extension = path.extname(filePath)
if extension is '.coffee'
content = fs.readFileSync(filePath, 'utf8')
cachePath = getCachePath(coffee)
compileCoffeeScript(coffee, filePath, cachePath)
else if extension is '.cson'
CSON.readFileSync(filePath)