@strapi/plugin-content-source-map

0.2.0 • Public • Published

Content Source Map

This plugin adds content source map support to a Strapi project. It is compatible with Vercel's visual editing feature.

You can learn more about Vercel's visual editing here.

This plugin requires a Strapi Enterprise Edition License. Contact our sales team if you don't already have one.

Installation

Add the plugin to your project

npm install @strapi/plugin-content-source-map

Configure the plugin in your project

./config/plugins.js

module.exports = () => ({
  'content-source-map': {
    enabled: true,
    config: {
      contentTypes: ['api::article.article', 'api::restaurant.restaurant'],
      origin: 'strapi.io',
      baseHref: 'https://my.strapi-admin.com',
    },
  },
});

Configuration

Name Description Default
contentTypes Array of content type uid to enable content source map for []
origin Origin defined in the source map and used to display the edit button  strapi.io
baseHref Base url of your Strapi admin panel Generated based on the server.url config

Usage

This plugin adds content source map support to the following APIs

  • GET /api/:contentType : list a content type entries
  • GET /api/:contentType/:id Retrieve a content type entry by id

To get the data with source map you will have to add the following query parameter to your API calls:

  • encodeSourceMaps=true

This will have performance impacts so you should use this only in draft mode or when doing previews.

Readme

Keywords

none

Package Sidebar

Install

npm i @strapi/plugin-content-source-map

Weekly Downloads

13

Version

0.2.0

License

SEE LICENSE IN LICENSE.md

Unpacked Size

7.42 kB

Total Files

5

Last publish

Collaborators

  • markkaylor
  • marc-roig-strapi
  • lauriejim
  • pierreburgy
  • aurelsicoko
  • alexandrebodin
  • convly