Should I rebuild `vue-storefront-*` projects after config been changed?


I’m nub in VSF & nodejs development. I found that I need to rebuild vue-storefront or vue-storefront-api projects after changes in ./config/local.json files:

$ yarn build
$ pm2 stop all
$ yarn start

Is yarn build step required or there is some other way to refresh config in the apps?



Hi Alex,

It depends on the situation…

In production mode

Yes, it’s necessary to run yarn build for vue-storefront to update the config. For vue-storefront-api, you can just run yarn start and it will automatically rebuild before starting.

I find it’s not necessary to run yarn pm2 stop all, if you rebuild the same instance. But it’s important to run yarn pm2 kill if you make another instance (eg copy the vue-storefront folder, or download a fresh copy to another location). I always do this, so I can rebuild without affecting the live site.

In Development mode

For both vue-storefront and vue-storefront-api, it’s not necessary to rebuild. In both cases, just stop the current applications (Ctrl+C) and run yarn dev again.

If you make any changes to the Vuex store definitions, (generally with custom modules), then a rebuild is needed.

I hope that helps


1 Like

Thanks, David.

I’m sorry for late answer of mine. Yes, it helps for me, I’m a complete nub in yarn/pm2/vsf :slight_smile:

Thanks again and have a nice day!