Plop generators.
# npm
npm i -D plop @rhao/plop-generators
# yarn or pnpm
pnpm add -D plop @rhao/plop-generators
If you use a
.cjs
configuration file, you must install@esbuild-kit/cjs-loader
and require it.
// plopfile.cjs
require('@esbuild-kit/cjs-loader')
const { setupGenerators } = require('@rhao/plop-generators')
module.exports = function (plop) {
setupGenerators(plop)
}
// plopfile.js
import { setupGenerators } from '@rhao/plop-generators'
export default function (plop) {
setupGenerators(plop)
}
// package.json
{
"scripts": {
"plop": "plop"
}
}
npm run plop