DEV Community

Elecweb
Elecweb

Posted on

Webpack plugin for fetch data at build time

About Static Source Data

The goal of this module is we want to show data in page from API Servie (e.g. Landing Page, About us), we don't want to fetch data in run time (using fetch or axios) because that make user waiting for loading data. It's ok for often chagning data to use fetch at run time but for rarely changing data, it might be better in some case if we can fetch data at build time.

Why don't we hardcode content?

We want to use data from API service because we might use CMS for non-technical person to update data (headless cms is good for this) and client fetch updated data via API service.

Who's suiable for this module

  • You want to show data which rarely updated in page (e.g. Landing Page, About us) and don't want to fetch at run time.
  • You don't want to hardcode content in html because it takes time due to require collaboration of developer and non-technical person for updating content.
  • You want to implement CMS or use headless CMS service for non-technical person update content. That ways, client need to fetch data via API servie somehow.
  • You don't want to keep track content file in your workspace.

if you're interested, you can look at our github.

https://github.com/20Scoops-CNX/static-source-data

Top comments (0)