zwiz-platform-account-avatar 中文文档教程
使用自定义 Babel 配置
此示例具有:
- 使用建议的 do 表达式 的应用程序。
- 它使用 babel-preset-stage-0,它允许我们使用上述 JavaScript 功能。
- 它使用应用程序目录中的“.babelrc”文件来添加上述预设。
大多数时候,在编写自定义
.babelrc
文件时,您需要添加next/babel
作为预设。
部署您自己的
使用 Vercel 部署示例,或使用 StackBlitz
如何使用
执行 create-next-app
与 npm、Yarn 或 < a href="https://pnpm.io">pnpm 引导示例:
npx create-next-app --example with-custom-babel-config with-custom-babel-config-app
yarn create next-app --example with-custom-babel-config with-custom-babel-config-app
pnpm create next-app --example with-custom-babel-config with-custom-babel-config-app
Using a custom Babel config
This example features:
- An app using proposed do expressions.
- It uses babel-preset-stage-0, which allows us to use above JavaScript feature.
- It uses '.babelrc' file in the app directory to add above preset.
Most of the time, when writing a custom
.babelrc
file, you need to addnext/babel
as a preset.
Deploy your own
Deploy the example using Vercel or preview live with StackBlitz
How to use
Execute create-next-app
with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-custom-babel-config with-custom-babel-config-app
yarn create next-app --example with-custom-babel-config with-custom-babel-config-app
pnpm create next-app --example with-custom-babel-config with-custom-babel-config-app
Deploy it to the cloud with Vercel (Documentation).