PlayForm / Inline

🦔 Inline —
https://NPMJS.Org/@playform/inline
Creative Commons Zero v1.0 Universal
205 stars 8 forks source link

Critters dont work if the url has a prefix #306

Closed TheElegantCoding closed 3 months ago

TheElegantCoding commented 3 months ago

if you have a build that puts a url in front of the css, this is the assetsPrefix option in astro, you will have this difference

<link rel="stylesheet" href="http://localhost:4321/_astro/index.Bd8XMnIY.css">

<link rel="stylesheet" href="/_astro/index.Bd8XMnIY.css">

and when you have a prefix with the url or domain dont works well, and don't inline nothing

NikolaRHristov commented 3 months ago

I'll take a look. Thank you.

TheElegantCoding commented 3 months ago

Critters has an option for this, you can pass publicPath as a string that will be remove from the original path, just need to add this option in the plugin for these cases

NikolaRHristov commented 3 months ago

Does it work if you pass it in the integration's options? You can override them like this:

export default {
    integrations: [
        (await import("@playform/inline")).default({
            Critters: { publicPath: "https://yoururl.com" },
        }),
    ],
 };
TheElegantCoding commented 3 months ago

yeah that works, didn't know that you can override the critters options, is not as an example in the readme