storyblok / storyblok-astro

Astro SDK for Storyblok CMS
158 stars 29 forks source link

storyblok-v2-latest.js loaded even when not in edit mode #885

Open mediabeastnz opened 1 month ago

mediabeastnz commented 1 month ago

storyblok.com

storyblok-v2-latest.js loaded even when not in edit mode which is a decent sized file that would increase performance if removed when not needed.


Expected Behavior

This script should only be loaded/injected into dom if the site is either in dev mode or edit mode. Not when the site is built or being served in production.

Current Behavior

https://app.storyblok.com/f/storyblok-v2-latest.js loads on all requests and environments.

Steps to Reproduce

This is my current astro configuration. No live preview but am using the Visual editor in storyblok.

...
output: "server",
storyblok({
    livePreview: false,
    apiOptions: {
        region: "ap",
        cache: {
            clear: "manual", // using flush to clear
        },
    },
    bridge: {
        resolveLinks: "url",
    },
})
J05HI commented 3 days ago

You have to set the bridge to false.