diff --git a/README.md b/README.md
index 10fef7a..923ec18 100644
--- a/README.md
+++ b/README.md
@@ -29,6 +29,10 @@ require("exports-loader?file,parse=helpers.parse!./file.js");
require("exports-loader?file!./file.js");
// adds below code to the file's source:
// module.exports = file;
+
+require("exports-loader?[name]!./file.js");
+// adds below code to the file's source:
+// module.exports = file;
```
Maintainers
diff --git a/index.js b/index.js
index 1941580..5c6032f 100644
--- a/index.js
+++ b/index.js
@@ -11,6 +11,10 @@ module.exports = function(content, sourceMap) {
var query = loaderUtils.getOptions(this) || {};
var exports = [];
var keys = Object.keys(query);
+ // apply name interpolation i.e. substitute strings like [name] or [ext]
+ for (var i = 0; i < keys.length; i++) {
+ keys[i] = loaderUtils.interpolateName(this, keys[i], {});
+ };
if(keys.length == 1 && typeof query[keys[0]] == "boolean") {
exports.push("module.exports = " + keys[0] + ";");
} else {