fix: tailwind now respects basepath (#2138)

This commit is contained in:
Reed von Redwitz
2023-12-05 13:13:33 +01:00
committed by GitHub
parent 80d35223d3
commit 60b2198d13
31 changed files with 323 additions and 12 deletions
+13
View File
@@ -0,0 +1,13 @@
{
"lock": false,
"imports": {
"$fresh/": "../../",
"preact": "https://esm.sh/preact@10.15.1",
"preact/": "https://esm.sh/preact@10.15.1/",
"tailwindcss": "npm:tailwindcss@3.3.5"
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
}
}
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env -S deno run -A --watch=static/,routes/
import dev from "$fresh/dev.ts";
import config from "./fresh.config.ts";
await dev(import.meta.url, "./main.ts", config);
@@ -0,0 +1,9 @@
import { defineConfig } from "$fresh/server.ts";
import tailwind from "$fresh/plugins/tailwind.ts";
export default defineConfig({
router: { basePath: "/foo/bar" },
plugins: [
tailwind(),
],
});
@@ -0,0 +1,19 @@
// DO NOT EDIT. This file is generated by Fresh.
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.
import * as $_app from "./routes/_app.tsx";
import * as $index from "./routes/index.tsx";
import { type Manifest } from "$fresh/server.ts";
const manifest = {
routes: {
"./routes/_app.tsx": $_app,
"./routes/index.tsx": $index,
},
islands: {},
baseUrl: import.meta.url,
} satisfies Manifest;
export default manifest;
+11
View File
@@ -0,0 +1,11 @@
/// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
import config from "./fresh.config.ts";
await start(manifest, config);
@@ -0,0 +1,17 @@
import { PageProps } from "$fresh/server.ts";
export default function App({ Component }: PageProps) {
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Fresh app</title>
<link rel="stylesheet" href="/styles.css" />
</head>
<body>
<Component />
</body>
</html>
);
}
@@ -0,0 +1,3 @@
export default function Page() {
return <h1 class="text-red-600 block">foo</h1>;
}
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@@ -0,0 +1,7 @@
import { Config } from "tailwindcss";
export default {
content: [
"{routes,islands,components}/**/*.{ts,tsx}",
],
} as Config;