I have very bad expirience with Vuestorefront rebuilding because every change in code takes about 25 second. So I decided to turn off SSR (for development) and now it takes about 3-4 seconds! ...but now there is problem with VueJs lifecycle.
What I use
- Official Vuestorefront repo: https://github.com/vuestorefront/vue-storefront
Storefront is installed with: yarn, demo API, SSR endpoints and default theme. Everything works perfectly, but it is slow for development.
- Optimized Webpack configuration: https://github.com/yireo-training/vsf1-local-webpack
Following tutorial in readme everything works fine, every change in code is builded in 4 second. Successful build automatically refresh website with hot-reload.
What is the problem?
- I can't open any link directly (link to product, category, etc...) and can't refresh/reload any page
I find out in these cases is skipped function asyncData which preload data. For example product page: https://github.com/vuestorefront/vsf-default/blob/master/pages/Product.vue#L334
When I click on product detail from homepage, function asyncData is triggered and product page is correctly loaded but with refresh (F5) is asyncData skipped.
I tried to reimplement code from asyncData to method beforeCreated but it still doesn't work.
My question
How to force calling function asyncData?
...or is there way to reconfigure Webpack to make this work?
...or is there another way to rebuild vuestorefront faster?
