mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? Updates Deploy button URLs for all listed examples here: https://github.com/vercel/next.js/tree/canary/examples ### Why? The Deploy URLs are currently broken and result in a failed clone attempt on Vercel. ### How? The URLs have been changed from https://vercel.com/new/git/external?… to -> https://vercel.com/new/clone?… (Last updated [here](https://github.com/vercel/next.js/commit/8eaabe2fb0fb3a1d9f4931a332e608395813a3b9) in 2021)
34 lines
1.5 KiB
Markdown
34 lines
1.5 KiB
Markdown
# Script component
|
|
|
|
This example shows different strategies that can be used for the [`next/script` component](https://nextjs.org/docs/basic-features/script):
|
|
|
|
- [Loading Polyfills](./pages/polyfill.tsx)
|
|
- [Lazy loading](./pages/lazy.tsx)
|
|
- [Executing code after loading](./pages/onload.tsx)
|
|
- [Inline scripts](./pages/inline.tsx)
|
|
- [Forwarding attributes](./pages/attributes.tsx)
|
|
|
|
## Deploy your own
|
|
|
|
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/script-component)
|
|
|
|
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/script-component&project-name=script-component&repository-name=script-component)
|
|
|
|
## How to use
|
|
|
|
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
|
|
|
|
```bash
|
|
npx create-next-app --example script-component script-component-app
|
|
```
|
|
|
|
```bash
|
|
yarn create next-app --example script-component script-component-app
|
|
```
|
|
|
|
```bash
|
|
pnpm create next-app --example script-component script-component-app
|
|
```
|
|
|
|
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
|