How to store all blog json data in separate folder with blog name and import them in frontity.settings.js

I mean. I am now able to use frontity on multisite But now my requirement is:

We put multiple package information inside frontity.settings.js array and export theme. Now I want to store all the package object in a separate file (such as: blog1.json, blog2.json etc… ) in a folder and import all those file dynamically using loop and export in frontity.settings.js so that it will work as per my requirement.

I have tried it and I could see all data in console and it compiled successfully but after that it throws error Screenshot by Lightshot

Hi @sanjeevsetu

I’m sorry, I don’t think I understand what you’re trying to do. Could you please explain in more detail what you’re attempting with some code samples. Also if you can provide a link to a repo that would be helpful too.

Here is the repo.

GitHub - Sanjeevsetu/news-theme.

Here you can see. I have been able to achieve the target but now facing another issue. I have removed the settings code to a separated folder called register-users and accessed theme in frontity.settings.js using loop. Everything is working fine on localhost but when I deploy on Vercel it throws error.


TypeError: Cannot read property ‘packages’ of undefined
at Object.t.default (/var/task/index.js:189:5294)
at Object.t.default (/var/task/index.js:189:4870)
at Object.t.default (/var/task/index.js:53:6264)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async t.default (/var/task/index.js:189:3650)
at async /var/task/index.js:250:16168
at async /var/task/index.js:58:17495
at async f (/var/task/index.js:250:13953)