I have a .astro file which looks like this:
<button class="my-button">I am a button efdefqfqef</button>
<button class="my-button" full-width>I am a button fluid</button>
<style>
@import "@jack/web-components/dist/button/button.css";
</style>
On Astro 6.0.6, I have to hit cmd + s multiple times before the style shows but at least when I type and change the button text, HMR refreshes.
From version "astro": "6.0.7", the style now does load correctly but HMR does not respond to changes to the content.
What can I do?
This is my dynamic route file:
---
import "@jack/web-components/dist/index.css";
import ExamplesHead from "#docs/components/core/ExamplesHead.astro";
export async function getStaticPaths() {
const componentExamples = import.meta.glob("../../../examples/components/**/[^_]*.astro");
const paths = [];
for (const entry of Object.keys(componentExamples)) {
const slug = entry.replace("../../../examples/components/", "").replace(".astro", "");
paths.push({
params: { slug: slug },
props: {
componentPath: slug,
entryPath: entry
},
});
}
return paths;
}
const { entryPath } = Astro.props;
const componentModule = await import.meta.glob("../../../examples/components/**/[^_]*.astro")[entryPath]() as { default: any };
const Component = componentModule.default;
---
<!doctype html>
<html lang="en">
<head>
<ExamplesHead title="Component mockup" />
</head>
<body>
<main data-pagefind-ignore>
<!-- Start of component mockup -->
<Component />
<!-- End of component mockup -->
</main>
</body>
</html>