Skip to content

Commit

Permalink
Merge pull request #38 from iivvaannxx/fix-rollup-paths
Browse files Browse the repository at this point in the history
Fixes #26 - Rollup not resolving path aliases on build.
  • Loading branch information
thejackshelton authored Nov 29, 2023
2 parents e408fe4 + 3435e81 commit d9880b0
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 13 deletions.
16 changes: 9 additions & 7 deletions apps/astro-demo/src/components/counter.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { Slot, component$, useSignal } from "@builder.io/qwik";
import { component$, useSignal } from "@builder.io/qwik";

export const Counter = component$<{ initial: number }>((props) => {
const counter = useSignal(0);

const counter = useSignal(props.initial);

return (
<button onClick$={() => counter.value++}>
<Slot />
<Slot name="test" />
{counter.value}
</button>

<>
<button onClick$={() => counter.value++}>
{counter.value}
</button>
</>
);
});
7 changes: 2 additions & 5 deletions apps/astro-demo/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import { Counter } from "../components/counter";
import { ReactCounter } from "../components/react-counter";
import { Counter } from "@components/counter";
---

<html lang="en">
Expand All @@ -13,10 +12,8 @@ import { ReactCounter } from "../components/react-counter";
</head>
<body>
<h1>Astro.js - Qwik</h1>
<Counter initial={9}>
<Counter initial={5}>
Some text!
<p>test</p>
<div slot="test">test</div>
</Counter>
</body>
</html>
7 changes: 7 additions & 0 deletions apps/astro-demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {

"baseUrl": ".",
"paths": {

"@components/*": ["./src/components/*"],
},

"jsx": "react-jsx",
"jsxImportSource": "@builder.io/qwik"
}
Expand Down
3 changes: 2 additions & 1 deletion libs/qwikdev-astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
},
"bugs": "https://github.com/thejackshelton/@qwikdev/astro/issues",
"dependencies": {
"fs-extra": "^11.1.1"
"fs-extra": "^11.1.1",
"vite-tsconfig-paths": "^4.2.1"
},
"devDependencies": {
"@builder.io/qwik": "^1.2.19",
Expand Down
2 changes: 2 additions & 0 deletions libs/qwikdev-astro/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { AstroConfig, AstroIntegration } from "astro";
import ts from "typescript";
import tsconfigPaths from 'vite-tsconfig-paths'

import { build, createFilter, type FilterPattern } from "vite";
import { qwikVite } from "@builder.io/qwik/optimizer";
Expand Down Expand Up @@ -93,6 +94,7 @@ export default function createIntegration(
input: "@qwikdev/astro/server",
},
}),
tsconfigPaths()
],
},
});
Expand Down
37 changes: 37 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d9880b0

Please sign in to comment.