Testing yeoman generator locally

后端 未结 2 473
逝去的感伤
逝去的感伤 2021-02-04 03:10

I\'m creating a yeoman generator for my web projects.

But I wonder how I can try and test my changes before publishing it?

Since I have installed it once, it wil

2条回答
  •  遇见更好的自我
    2021-02-04 03:42

    If by "running locally" you mean the ability to test your generator and its flow you can simply do this.

    1. In your project directory folder run npm link. If this passes in flying colors, go to step 2.
    2. Open a terminal and cd into the folder you wish to initiate a project.
    3. Run yo generator-theNameOfYourGenerator. This will run your generator.

提交回复
热议问题