JSPM

strapi-plugin-cdn-prefix

1.0.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q64483F
  • License MIT

Prepend image urls with CDN Prefix

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (strapi-plugin-cdn-prefix) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Strapi CDN Prefix Plugin

    This Strapi plugin allows you to automatically prepend a CDN link to your image URLs on both Admin Panel and API's.

    ⚙️ Installation

    #  NPM
    npm install strapi-plugin-cdn-prefix
    
    # Yarn
    yarn add strapi-plugin-cdn-prefix

    🌐 Environment Configuration

    For the plugin to work correctly, you need to add specific environment variables to your Strapi project. Add the following to your .env file:

    #  .env
    CDN_DOMAIN = cdn.example.com
    CDN_IMAGES_BASE_PATH = https://cdn.example.com/images/uploads

    🚀 Usage

    Once the plugin is installed and configured:

    1. Upload a new image or use an existing one from the Media Library.
    2. The image URL will automatically have the CDN base path prepended.

    For example, if the image's path is /uploads/image.jpg, the output will be https://cdn.example.com/images/uploads/image.jpg.