Simpler dst file name generation

Module developers can easily customize filename using fileName key
otherwise it is generated using `[dirname].[filename].[hash].[ext]` template
This commit is contained in:
Pooya Parsa 2017-05-12 00:07:59 +04:30
parent 7835e3611d
commit d57ea4de88

View File

@ -31,8 +31,8 @@ class Module {
return return
} }
// Generate unique and human readable dst filename // Generate unique and human readable dst filename
const dst = template.dst || const dst = template.fileName ||
((template.dstName || (path.basename(srcPath.dir) + '.' + srcPath.name)) + '.' + hash(src) + (template.dstExt || srcPath.ext)) (path.basename(srcPath.dir) + '.' + srcPath.name + '.' + hash(src) + '.' + srcPath.ext)
// Add to templates list // Add to templates list
const templateObj = { const templateObj = {