From 6addd0695d4fec896431dfa15f7815169ff6f8e9 Mon Sep 17 00:00:00 2001 From: thejackshelton Date: Sun, 24 Mar 2024 20:01:21 -0500 Subject: [PATCH] fix: customize outdir --- apps/astro-demo/astro.config.mjs | 4 ++-- libs/qwikdev-astro/src/index.ts | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/astro-demo/astro.config.mjs b/apps/astro-demo/astro.config.mjs index 8546a08..ce5f421 100644 --- a/apps/astro-demo/astro.config.mjs +++ b/apps/astro-demo/astro.config.mjs @@ -10,6 +10,6 @@ export default defineConfig({ adapter: node({ mode: "standalone" }), - - integrations: [qwik({ include: "**/qwik/*" }), react({ include: "**/react/*" })] + integrations: [qwik({ include: "**/qwik/*" }), react({ include: "**/react/*" })], + outDir: "my-project" }); diff --git a/libs/qwikdev-astro/src/index.ts b/libs/qwikdev-astro/src/index.ts index 342f9ee..b61d9c5 100644 --- a/libs/qwikdev-astro/src/index.ts +++ b/libs/qwikdev-astro/src/index.ts @@ -83,19 +83,21 @@ export default defineIntegration({ entrypoints = getQwikEntrypoints(srcDir, filter); if ((await entrypoints).length !== 0) { + distDir = astroConfig.outDir.pathname; + await fsExtra.ensureDir(distDir); + addRenderer({ name: "@qwikdev/astro", serverEntrypoint: resolve("../server.ts") }); - // Update the global dist directory - distDir = astroConfig.outDir.pathname; - // checks all windows platforms and removes drive ex: C:\\ if (os.platform() === "win32") { distDir = distDir.substring(3); } + console.log("DIST DIR", distDir); + updateConfig({ vite: { build: { @@ -124,7 +126,8 @@ export default defineIntegration({ all of the entry points to the application so that we can generate the manifest. */ - input: await entrypoints + input: await entrypoints, + outDir: "my-project" }, ssr: { input: resolve("../server.ts")