From c95baf6f99804f200c0e5110c2b32fe6d2c875c0 Mon Sep 17 00:00:00 2001 From: KarateKid Date: Fri, 18 Mar 2016 21:23:18 +0800 Subject: [PATCH] add the path of current file to the list of arguments --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 7d22e68..d743ceb 100644 --- a/index.js +++ b/index.js @@ -79,8 +79,8 @@ function plugin(options) { var contents = file.contents.toString(); renames.forEach(function replaceOnce(rename) { - var unreved = options.modifyUnreved ? options.modifyUnreved(rename.unreved) : rename.unreved; - var reved = options.modifyReved ? options.modifyReved(rename.reved) : rename.reved; + var unreved = options.modifyUnreved ? options.modifyUnreved(rename.unreved, file.path) : rename.unreved; + var reved = options.modifyReved ? options.modifyReved(rename.reved, file.path) : rename.reved; contents = contents.split(unreved).join(reved); if (options.prefix) { contents = contents.split('/' + options.prefix).join(options.prefix + '/');