nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.12k stars 623 forks source link

only SSR/SSG mode #534

Open amotarao opened 4 years ago

amotarao commented 4 years ago

Is your feature request related to a problem? Please describe.

I deploy generated diff files in some projects. I change db-hash to see the diffs after 'yarn generate'. Also, the project uses nuxt/content only for ssr/ssg, not the client.

Describe the solution you'd like

I want ssr/ssg only mode (option).

Describe alternatives you've considered

atinux commented 3 years ago

Hi @amotarao

I am not sure to fully understand your request :grimacing:

amotarao commented 3 years ago

Hello @Atinux I’m sorry for the late reply.

I have a case what use nuxt/content at asyncData on only nuxt generate . In this case, $content, config.content (at each state.js) and db-hash.json are not required from client. I want option that support this case.

atinux commented 3 years ago

I don't think that's possible if we want to keep content working on SPA fallback or even using the search (that needs to load the db-hash.json).

What is the problem or having them on client-side since they are lazy-loaded by default for best performances?

amotarao commented 3 years ago

In this case, I don't use fallback.

The problem is not performance, there is a huge db.json.

atinux commented 3 years ago

What target do you use for Nuxt @amotarao ?

amotarao commented 3 years ago

I use static.

atinux commented 3 years ago

So in order to work consistently, we need to have the db.json available when using $content().search() or having the SPA fallback for example.

We are planning to support Serverless environment for Nuxt Content, this way, the db.json won't be embedded on client-side.

amotarao commented 3 years ago

Yes. I understand it. BUT, I don't use $content (client) or SPA fallback in this case.

$content required ONLY at nuxt generate.

atinux commented 3 years ago

I see, then the db.json will never be loaded on client-side. It is loaded dynamically in case of accessing $content on client-side.

amotarao commented 3 years ago

Yes, but I need to delete db-hash.json.

So, If the hash is customizable, I can solve the problem, so I'll create another issue.

amotarao commented 3 years ago

created #792

atinux commented 3 years ago

Keeping this one open