Loading generators from packages #7542
-
SummaryIs it possible to load generators from installed packages? E.g. I already distribute generators as an npm package for our org, and they simply need to be installed. Currently, we use plop directly (not turbo gen), and for that I have to do a bit of magic: import type { NodePlopAPI } from 'plop'
module.exports = async function (plop: NodePlopAPI) {
return plop.load([
"./plopfile.ts", // <-- this loads a local one
"@foo/plop-generator-bar", // <-- this is loaded from a package
"@foo/plop-generator-baz", // <-- this is loaded from a package
])
} But was wondering if, perhaps, turbo was smart and would be able to somehow discover these generators automatically, as it does already with local ones. Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This isn't possible and doesn't sound feasible to me as we would need to walk through node_modules to discover generators. You can, however, install a generator and use it in a generator file. |
Beta Was this translation helpful? Give feedback.
This isn't possible and doesn't sound feasible to me as we would need to walk through node_modules to discover generators. You can, however, install a generator and use it in a generator file.