README
@slvrdigital/statics-prefetch
Features
- Prefetch static data
- Format response data
Quick Setup
- Add
@slvrdigital/statics-prefetch
dependency to your project
npm install @slvrdigital/statics-prefetch # or yarn add @slvrdigital/statics-prefetch
- Add
@slvrdigital/statics-prefetch
to thebuildModules
section ofnuxt.config.js
(ormodules
if on Nuxt < 2.9>)
{
buildModules: [
'@slvrdigital/statics-prefetch',
],
}
Add Options
Add services config and more using the module options.
staticsPrefetch: {
stopOnFail: false,
serviceCollection: [
{
url: 'https://jsonplaceholder.typicode.com/posts',
saveAs: 'posts.json'
}
]
}
See module options.
Usage
Run the dev
or build
command and you will see pre-fetched data in the Nuxt CLI which you can then import and use in app.
Simple use example:
npm run dev # or npm run build
or
yarn dev # or yarn build
See Usage.
Development
- Clone this repository
- Install dependencies using
npm install
oryarn add
- Start development server using
npm run dev
oryarn dev