From 525492aaf7327eb9ce49e68e3268040fb35a1cae Mon Sep 17 00:00:00 2001 From: Vladimir Kostin <boba.keyost@gmail.com> Date: Wed, 22 May 2019 12:45:48 +0300 Subject: [PATCH 1/2] use function as content --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index e869e1d..f2191ad 100644 --- a/index.js +++ b/index.js @@ -26,6 +26,7 @@ var CreateFilePlugin = (function () { function _createFile(filePath, fileName, content) { return () => { const fullPath = path.join(filePath, fileName); + const contentData = typeof content === 'function' ? content(filePath, fileName) : content; write.sync(fullPath, content); } } From 4436f2996816ec5725b705b78f2266cf81b33035 Mon Sep 17 00:00:00 2001 From: Vladimir Kostin <boba.keyost@gmail.com> Date: Wed, 22 May 2019 12:49:18 +0300 Subject: [PATCH 2/2] use function as content fix --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index f2191ad..ff7ac96 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ var CreateFilePlugin = (function () { return () => { const fullPath = path.join(filePath, fileName); const contentData = typeof content === 'function' ? content(filePath, fileName) : content; - write.sync(fullPath, content); + write.sync(fullPath, contentData); } }