Skip to content

Commit 2af2e4a

Browse files
changeset
1 parent 026ddeb commit 2af2e4a

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

.changeset/green-jobs-jog.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
"@qwikdev/astro": patch
3+
---
4+
5+
feat: support global config for renderOpts
6+
7+
You can now pass the `renderOpts` option to the `qwik` integration to set global render options for all Qwik components.
8+
9+
For example, let's say we wanted to change the base URL for all Qwik build assets on every component used in an Astro file.
10+
11+
```ts
12+
import { defineConfig } from "astro/config";
13+
import qwik from "@qwikdev/astro";
14+
15+
export default defineConfig({
16+
integrations: [qwik({ include: "**/qwik/*", renderOpts: { base: "my-cdn-url/build" } })]
17+
});
18+
```

apps/demo/astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import qwik from "@qwikdev/astro";
44

55
// https://astro.build/config
66
export default defineConfig({
7-
integrations: [qwik({ include: "**/qwik/*", renderOpts: { base: "http://192.168.68.76:4321/build" } })]
7+
integrations: [qwik({ include: "**/qwik/*" })]
88
});

libs/qwikdev-astro/src/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,9 @@ export default defineIntegration({
107107
serverEntrypoint: resolver("../server.ts")
108108
});
109109

110-
if (options?.renderOpts) {
111-
defineModule('virtual:qwikdev-astro', {
112-
defaultExport: options.renderOpts,
113-
});
114-
}
110+
defineModule('virtual:qwikdev-astro', {
111+
defaultExport: options?.renderOpts,
112+
});
115113

116114
/** Relative paths, as the Qwik optimizer handles normalization */
117115
srcDir = getRelativePath(astroConfig.root.pathname, astroConfig.srcDir.pathname);

0 commit comments

Comments
 (0)