Skip to content

demo: add with next.js #315

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

Merged
merged 1 commit into from
Apr 22, 2025
Merged
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ stats.html
.vscode
.setting
build/
.next/
npm-debug.log*
npm-error.log*
yarn-debug.log*
Expand Down
3 changes: 3 additions & 0 deletions demos/with-next/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
35 changes: 35 additions & 0 deletions demos/with-next/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
29 changes: 29 additions & 0 deletions demos/with-next/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

## Getting Started

First, run the development server:

```bash
# install dependencies
pnpm install

# development
pnpm run dev

# production build
pnpm run build

# deploy
pnpm run start
```

## 组件说明

```tsx
/**
* 由于播放器sdk 内部有很多方法挂载在 window 上,所以需要将播放器组件放在客户端渲染
*/
const Player = dynamic(() => import('@/components/Player'), {
ssr: false // This ensures the component is not SSR'd
});
```
1 change: 1 addition & 0 deletions demos/with-next/additional.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module "ezuikit-js";
4 changes: 4 additions & 0 deletions demos/with-next/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}

module.exports = nextConfig
Loading