mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
🐎 Cache compiled CSON files
This configures season to use a cache directory similar to the coffee cache so that dev windows don't have to recompile CSON file on each load. This shaves hundreds of milliseconds off of the dev window load time. The cached CSON files are located in /tmp/atom-compile-cache/cson
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
"pegjs": "0.7.0",
|
||||
"plist": "git://github.com/nathansobo/node-plist.git",
|
||||
"rimraf": "2.1.4",
|
||||
"season": "0.12.0",
|
||||
"season": "0.13.0",
|
||||
"semver": "1.1.4",
|
||||
"space-pen": "1.2.0",
|
||||
"tantamount": "0.3.0",
|
||||
|
||||
@@ -3,13 +3,16 @@ fs = require 'fs'
|
||||
path = require 'path'
|
||||
|
||||
CoffeeScript = require 'coffee-script'
|
||||
CSON = require 'season'
|
||||
mkdir = require('mkdirp').sync
|
||||
|
||||
cacheDir = '/tmp/atom-compile-cache/coffee'
|
||||
cacheDir = '/tmp/atom-compile-cache'
|
||||
coffeeCacheDir = path.join(cacheDir, 'coffee')
|
||||
CSON.setCacheDir(path.join(cacheDir, 'cson'))
|
||||
|
||||
getCachePath = (coffee) ->
|
||||
digest = crypto.createHash('sha1').update(coffee, 'utf8').digest('hex')
|
||||
path.join(cacheDir, "#{digest}.coffee")
|
||||
path.join(coffeeCacheDir, "#{digest}.coffee")
|
||||
|
||||
getCachedJavaScript = (cachePath) ->
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user