Skip to content
This repository was archived by the owner on Apr 26, 2022. It is now read-only.

Commit de8b5d1

Browse files
authored
Merge branch 'master' into fix/templateFiles-array-of-string-type
2 parents 7b24a80 + 85be372 commit de8b5d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node-plop.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ function nodePlop(plopfilePath = '', plopCfg = {}) {
190190
setPlopfilePath(plopfilePath);
191191
loadPackageJson();
192192

193-
require(path.join(plopfilePath, plopFileName))(plopfileApi, plopCfg);
193+
const plopFileExport = require(path.join(plopfilePath, plopFileName));
194+
const plop = typeof plopFileExport === 'function' ? plopFileExport : plopFileExport.default;
195+
196+
plop(plopfileApi, plopCfg);
194197
} else {
195198
setPlopfilePath(process.cwd());
196199
loadPackageJson();

0 commit comments

Comments
 (0)