Use grunt: https://docs.nodebb.org/configuring/running/#grunt-development

It will automatically rebuild what is necessary and restart when you make a change.