Can I have per-project Yeoman generators?

Viewed 148

I have a Node project and I wanted to make a custom generator of components for this specific project.

I got it working by creating the generator as a separate package, but that's inconvenient - now I have to manage versioning of two packages instead of one, and rely on yarn link for development.

my-project/
    src/
        ...
    package.json
        {   
            ...
            "devDependencies": {
                "my-project-generator": "file:../my-project-generator"
            ]
        }
my-project-generator/
    generators/
        ...
    package.json
        {
            ...
            "keywords": ["yeoman-generator"]
        }

Is there a way to keep the generator inside the project itself? I tried this but yo didn't discover the generator.

my-project/
    src/
        ...
    generators/
        ...
    package.json
        {   
            "keywords": ["yeoman-generator"]
            ...
        }
1 Answers
Related