diff --git a/Data/FileEmbed.hs b/Data/FileEmbed.hs
--- a/Data/FileEmbed.hs
+++ b/Data/FileEmbed.hs
@@ -23,6 +23,9 @@
 #endif
     , Q
     , runIO
+#if MIN_VERSION_template_haskell(2,7,0)
+    , Quasi(qAddDependentFile)
+#endif
     )
 import System.Directory (doesDirectoryExist, doesFileExist,
                          getDirectoryContents)
@@ -42,7 +45,11 @@
 -- > myFile :: Data.ByteString.ByteString
 -- > myFile = $(embedFile "dirName/fileName")
 embedFile :: FilePath -> Q Exp
-embedFile fp = (runIO $ B.readFile fp) >>= bsToExp
+embedFile fp =
+#if MIN_VERSION_template_haskell(2,7,0)
+    qAddDependentFile fp >>
+#endif
+  (runIO $ B.readFile fp) >>= bsToExp
 
 -- | Embed a directory recusrively in your source code.
 --
@@ -61,6 +68,9 @@
 
 pairToExp :: (FilePath, B.ByteString) -> Q Exp
 pairToExp (path, bs) = do
+#if MIN_VERSION_template_haskell(2,7,0)
+    qAddDependentFile path
+#endif
     exp' <- bsToExp bs
     return $! TupE [LitE $ StringL path, exp']
 
diff --git a/file-embed.cabal b/file-embed.cabal
--- a/file-embed.cabal
+++ b/file-embed.cabal
@@ -1,5 +1,5 @@
 name:            file-embed
-version:         0.0.4.1
+version:         0.0.4.2
 license:         BSD3
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
