mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 16:08:24 +03: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:
parent
a788a7e9b7
commit
47bd093d68
@ -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")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user