diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -45,7 +45,9 @@ module.exports = function(source, sourceMap) {
             if (typeof query[filePath] === 'object') {
                 var fileConfig = query[filePath];
                 var loaderStringForFile = fileConfig.loaders || '';
-                loadersForFile = loaderStringForFile.replace(/\*/g, '!') + '!';
+                if (loaderStringForFile) {
+                    loadersForFile = loaderStringForFile.replace(/\*/g, '!') + '!';
+                }
 
                 varName = fileConfig.varName;
             }
Adding conditional around loader string generation.