diff --git a/index.js b/index.js index d3d64d12..7e7b748e 100644 --- a/index.js +++ b/index.js @@ -22,7 +22,6 @@ var transpile = function(source, options) { }; module.exports = function(source, inputSourceMap) { - var callback = this.async(); var result = {}; // Handle options var defaultOptions = { @@ -50,6 +49,7 @@ module.exports = function(source, inputSourceMap) { this.cacheable(); if (cacheDirectory) { + var callback = this.async(); return cache({ directory: cacheDirectory, identifier: cacheIdentifier, @@ -63,6 +63,6 @@ module.exports = function(source, inputSourceMap) { } result = transpile(source, options); - return callback(null, result.code, result.map); + this.callback(null, result.code, result.map); };