Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: test tailwind-v4 vite plugin
  • Loading branch information
hi-ogawa committed Feb 8, 2025
commit e334d35fb9c49c908b215cfb964a587a5cdf91ab
1 change: 1 addition & 0 deletions packages/react-server/examples/tailwind-v4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tailwind v4
11 changes: 11 additions & 0 deletions packages/react-server/examples/tailwind-v4/app/_action.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"use server";

let count = 0;

export async function changeCount() {
count++;
}

export function getCount() {
return count;
}
9 changes: 9 additions & 0 deletions packages/react-server/examples/tailwind-v4/app/_client.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use client";

import React from "react";

export function TestClient() {
const [count, setCount] = React.useState(0);

return <button onClick={() => setCount(count + 1)}>Client: {count}</button>;
}
12 changes: 12 additions & 0 deletions packages/react-server/examples/tailwind-v4/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type React from "react";

export default function Layout(props: React.PropsWithChildren) {
return (
<html>
<body>
<div>[Layout]</div>
{props.children}
</body>
</html>
);
}
14 changes: 14 additions & 0 deletions packages/react-server/examples/tailwind-v4/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { changeCount, getCount } from "./_action";
import { TestClient } from "./_client";

export default function Page() {
return (
<>
<div>[Page]</div>
<TestClient />
<form action={changeCount}>
<button>Action: {getCount()}</button>
</form>
</>
);
}
25 changes: 25 additions & 0 deletions packages/react-server/examples/tailwind-v4/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@hiogawa/react-server-example-tailwind-v4",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@hiogawa/react-server": "workspace:*",
"next": "link:../../../react-server-next",
"react": "rc",
"react-dom": "rc",
"react-server-dom-webpack": "rc"
},
"devDependencies": {
"@tailwindcss/vite": "^4.0.4",
"@types/react": "latest",
"@types/react-dom": "latest",
"tailwindcss": "^3.4.10",
"vite": "latest"
}
}
17 changes: 17 additions & 0 deletions packages/react-server/examples/tailwind-v4/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"include": ["**/*.ts", "**/*.tsx"],
"compilerOptions": {
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"skipLibCheck": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"moduleResolution": "Bundler",
"module": "ESNext",
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"types": ["next"],
"jsx": "react-jsx"
}
}
10 changes: 10 additions & 0 deletions packages/react-server/examples/tailwind-v4/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import next from "next/vite";
import { defineConfig } from "vite";
import tailwindcss from '@tailwindcss/vite'

export default defineConfig({
plugins: [
next(),
tailwindcss(),
],
});
Loading
Loading