     @disposable.add atom.workspace.observeTextEditors (textEditor) =>
       @textEditors[textEditor.id] = new CompositeDisposable
       @textEditors[textEditor.id].add textEditor.onDidSave (event) =>
-        if atom.workspace.getActiveTextEditor().id is textEditor.id and
-        textEditor.getGrammar().packageName is 'language-babel'
-          @transpiler.transpile(event.path, textEditor)
+        if textEditor.getGrammar().packageName is 'language-babel'
+          filePath = textEditor.getPath()
+          lastSaveTime = @fileSaveTimes[filePath]
+          @fileSaveTimes[filePath] = Date.now()
+          if not lastSaveTime? + INTERFILESAVETIME < @fileSaveTimes[filePath]
+            @transpiler.transpile(filePath, textEditor)
       @textEditors[textEditor.id].add textEditor.onDidDestroy () =>
+        filePath = textEditor.getPath()
+        if @fileSaveTimes[filePath]? then delete@fileSaveTimes[filePath]
         @textEditors[textEditor.id].dispose()
         delete @textEditors[textEditor.id]
 
   deactivate: ->
     @disposable.dispose()
     for id, disposeable of @textEditors
-      disposeable.dispose()    
+      disposeable.dispose()
+    for filePath, val of @fileSaveTimes
+      delete@fileSaveTimes[filePath]
     @transpiler.stopAllTranspilerTask()

    # track any file save events and transpile if babel
    @disposable = new CompositeDisposable
    @textEditors = {}

    @disposable.add atom.project.onDidChangePaths =>
      @transpiler.stopUnusedTasks()

{CompositeDisposable} = require 'atom'

INTERFILESAVETIME = 1000

module.exports =
  config: require './config'
