Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: test next on vite #1

Open
wants to merge 5 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions examples/material-ui-nextjs-ts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

# production
/build
/dist

# misc
.DS_Store
Expand Down
7 changes: 7 additions & 0 deletions examples/material-ui-nextjs-ts/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
```sh
vercel projects add material-ui-next-vite
vercel link -p material-ui-next-vite
VERCEL=1 pnpm build
vercel deploy --prebuilt --prod
```

# Material UI - Next.js App Router example in TypeScript

This is a [Next.js](https://nextjs.org/) project bootstrapped using [`create-next-app`](https://github.com/vercel/next.js/tree/HEAD/packages/create-next-app) with Material UI installed.
Expand Down
11 changes: 7 additions & 4 deletions examples/material-ui-nextjs-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
"post-update": "echo \"codesandbox preview only, need an update\" && pnpm update --latest"
},
"dependencies": {
"@hiogawa/react-server": "https://pkg.pr.new/hi-ogawa/vite-plugins/@hiogawa/react-server@6ef3cdb",
"next": "https://pkg.pr.new/hi-ogawa/vite-plugins/@hiogawa/react-server-next@6ef3cdb",
"react": "rc",
"react-dom": "rc",
"react-server-dom-webpack": "rc",
"vite": "latest",
"@emotion/cache": "latest",
"@emotion/react": "latest",
"@emotion/styled": "latest",
"@mui/icons-material": "next",
"@mui/material": "next",
"@mui/material-nextjs": "next",
"next": "latest",
"react": "latest",
"react-dom": "latest"
"@mui/material-nextjs": "next"
},
"devDependencies": {
"@types/node": "latest",
Expand Down
4,827 changes: 4,827 additions & 0 deletions examples/material-ui-nextjs-ts/pnpm-lock.yaml

Large diffs are not rendered by default.

Empty file.
Binary file added examples/material-ui-nextjs-ts/public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/material-ui-nextjs-ts/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
import AppRouterCacheProvider from '@mui/material-nextjs/v13-appRouter/appRouterV13';
import { ThemeProvider } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import theme from '@/theme';
Expand Down
18 changes: 9 additions & 9 deletions examples/material-ui-nextjs-ts/src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
'use client';
import { Roboto } from 'next/font/google';
// import { Roboto } from 'next/font/google';
import { createTheme } from '@mui/material/styles';

const roboto = Roboto({
weight: ['300', '400', '500', '700'],
subsets: ['latin'],
display: 'swap',
});
// const roboto = Roboto({
// weight: ['300', '400', '500', '700'],
// subsets: ['latin'],
// display: 'swap',
// });

const theme = createTheme({
palette: {
mode: 'light',
},
typography: {
fontFamily: roboto.style.fontFamily,
},
// typography: {
// fontFamily: roboto.style.fontFamily,
// },
components: {
MuiAlert: {
styleOverrides: {
Expand Down
2 changes: 1 addition & 1 deletion examples/material-ui-nextjs-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
Expand Down
11 changes: 11 additions & 0 deletions examples/material-ui-nextjs-ts/vite.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import next from "next/vite";
import { defineConfig } from "vite";

export default defineConfig({
plugins: [
next({ routeDir: "src/app" })
],
ssr: {
noExternal: ["@mui/**"],
}
});