nie

nuxt-image-extractor

Nuxt image extractor for full static generated sites

Showing:

Popularity

Downloads/wk

68

GitHub Stars

23

Maintenance

Last Commit

5mos ago

Contributors

4

Package

Dependencies

0

Size (min+gzip)

2.1KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

nuxt-image-extractor

npm version npm downloads

Nuxt image extractor for full static generated sites

This module is based on this gist from emiliobondioli.

It parses each generated page, downloads its images from your CMS API, stores them in a folder inside /dist and finally replace the HTML sources with the local paths.

  • Works with both nuxt generate and nuxt export commands.

  • Supports image url params like ?itok=gmJP5AbR.

  • It replaces payload image links as well, although this is not fully tested yet. So use with caution!

Setup

  1. Add nuxt-image-extractor dependency to your project
yarn add nuxt-image-extractor # or npm install nuxt-image-extractor
  1. Add nuxt-image-extractor to the modules section of nuxt.config.js
{
  modules: [
    [
      'nuxt-image-extractor',
      {
        // (Required) CMS url
        baseUrl: process.env.BASE_URL,

        // (Optional) Dir where downloaded images will be stored
        path: '/_images',

        // (Optional) Array containing image formats
        extensions: ['jpg', 'jpeg', 'gif', 'png', 'webp', 'svg'],
      }
    ]
  ]
}

License

MIT License

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100