diff --git a/index.js b/index.js index e869e1d..ff7ac96 100644 --- a/index.js +++ b/index.js @@ -26,7 +26,8 @@ var CreateFilePlugin = (function () { function _createFile(filePath, fileName, content) { return () => { const fullPath = path.join(filePath, fileName); - write.sync(fullPath, content); + const contentData = typeof content === 'function' ? content(filePath, fileName) : content; + write.sync(fullPath, contentData); } }