From d57ea4de88f9f96569e70f94ced2285b271d0134 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 12 May 2017 00:07:59 +0430 Subject: [PATCH] Simpler dst file name generation Module developers can easily customize filename using fileName key otherwise it is generated using `[dirname].[filename].[hash].[ext]` template --- lib/module.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/module.js b/lib/module.js index 0a18a5286b..d2e059ffea 100755 --- a/lib/module.js +++ b/lib/module.js @@ -31,8 +31,8 @@ class Module { return } // Generate unique and human readable dst filename - const dst = template.dst || - ((template.dstName || (path.basename(srcPath.dir) + '.' + srcPath.name)) + '.' + hash(src) + (template.dstExt || srcPath.ext)) + const dst = template.fileName || + (path.basename(srcPath.dir) + '.' + srcPath.name + '.' + hash(src) + '.' + srcPath.ext) // Add to templates list const templateObj = {