Avoid nodebb rebuild all the time



  • So I'm doing some changes to a custom page that I've got. Every time I change something, I need to do a nodebb rebuild in order to see my changes in effect.

    Is there a way to disable this and force NodeBB to build the template every time it gets rendered? This way I could make changes to my .tpl file, save it, press F5 and I would see my changes in effect without having to shutdown my server, doing a nodebb rebuild and starting my server again.

    I feel like I'm missing something...


  • Global Moderator

    There's no way to do exactly what you want, but you can use grunt for development, which automatically detects file changes and rebuilds accordingly.

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



  • Sadly, this is still very slow. Thanks for the help though.


  • GNU/Linux

    @rdomzim said in Avoid nodebb rebuild all the time:

    without having to shutdown my server, doing a nodebb rebuild and starting my server again.

    A dev can correct me, but for quite a while now, you have been able to to a nodebb rebuild while the server is running. Then you simply to a nodebb restart when the build is done. Very little impact to your users.



  • When I said "shutdown my server" and "starting it again" I meant locally, not production. So I'm not really worried about the impact to my users, but the development speed instead.


  • Global Moderator

    Grunt shouldn't be too slow, especially if it's just rebuilding one or two of the asset types at once.

    How slow is it?



  • At least 10 seconds to restart NodeBB and more 10 seconds for my plugin to load some stuff from my database and do other startups. In the case below, I simply added a space in my subscribe2.tpl and saved it.

    >> File "node_modules\nodebb-plugin-myplugin\templates\subscribe2.tpl" changed.
      started
    2018-11-04T07:57:31.402Z [19060] - info: [themes] Using theme nodebb-theme-persona
    2018-11-04T07:57:32.324Z [19060] - info: [build] Building in parallel mode
    2018-11-04T07:57:32.326Z [19060] - info: [build] templates  build started
    2018-11-04T07:57:33.295Z [19060] - info: [build] templates  build completed in 0.969sec
    2018-11-04T07:57:33.296Z [19060] - info: [build] Asset compilation successful. Completed in 0.97sec.
    2018-11-04T07:57:34.021Z [6952] - info: Initializing NodeBB v1.10.1 http://127.0.0.1:8081
    2018-11-04T07:57:37.405Z [6952] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `nodebb-plugin-emoji-extended`. Skipping.
    2018-11-04T07:57:39.417Z [6952] - info: [themes] Using theme nodebb-theme-persona
    2018-11-04T07:57:39.920Z [6952] - info: [plugins] Plugins OK
    2018-11-04T07:57:41.873Z [6952] - info: Routes added
    2018-11-04T07:57:42.053Z [6952] - info: NodeBB Ready
    2018-11-04T07:57:42.058Z [6952] - info: Enabling 'trust proxy'
    2018-11-04T07:57:42.061Z [6952] - info: NodeBB is now listening on: 127.0.0.1:8081
    

Log in to reply
 

Suggested Topics

| |