mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
🐎 Load 6to5 version directly from package.json
This prevents the entire library from being required just to check the cache so when 6to5 is being used and all files are cached it should shave ~250ms off startup.
This commit is contained in:
@@ -95,9 +95,9 @@ getCachePath = (sourceCode) ->
|
||||
digest = crypto.createHash('sha1').update(sourceCode, 'utf8').digest('hex')
|
||||
|
||||
unless jsCacheDir?
|
||||
to5 ?= require '6to5-core'
|
||||
to5Version = require('6to5-core/package.json').version
|
||||
cacheDir = path.join(fs.absolute('~/.atom'), 'compile-cache')
|
||||
jsCacheDir = path.join(cacheDir, 'js', '6to5', create6to5VersionAndOptionsDigest(to5.version, defaultOptions))
|
||||
jsCacheDir = path.join(cacheDir, 'js', '6to5', create6to5VersionAndOptionsDigest(to5Version, defaultOptions))
|
||||
|
||||
path.join(jsCacheDir, "#{digest}.js")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user