add environment to register cache key

This commit is contained in:
Sebastian McKenzie 2015-05-15 17:34:06 +01:00
parent 2e46755260
commit 7a09640b20

View File

@ -53,6 +53,9 @@ var compile = function (filename) {
var cacheKey = `${filename}:${JSON.stringify(opts)}:${babel.version}`;
var env = process.env.BABEL_ENV || process.env.NODE_ENV;
if (env) cacheKey += `:${env}`;
if (cache) {
var cached = cache[cacheKey];
if (cached && cached.mtime === mtime(filename)) {