简体   繁体   English

--example 标志在创建 NextJs 应用时的意义是什么

[英]What is the significance of the --example flag on creating NextJs app

I am beginning to learn NextJs and I came across this command to create a new NextJs App我开始学习 NextJs,我遇到了这个命令来创建一个新的 NextJs 应用程序

npx create-next-app nextjs-blog --use-npm --example "https://github.com/vercel/next-learn/tree/master/basics/learn-starter"

I wish to know the significance of the --example flag.我想知道 --example 标志的意义。 I could not find any explanation for that.我找不到任何解释。

The --example flag tells create-next-app which template to use. --example标志告诉create-next-app使用哪个模板。 Here's the flag in the source :这是源代码中的标志:

  .option(
    '-e, --example [name]|[github-url]',
    `
  An example to bootstrap the app with. You can use an example name
  from the official Next.js repo or a GitHub URL. The URL can use
  any branch and/or subdirectory
`
  )

There's also a note about it in the tutorial :教程中还有一个关于它的注释:

Under the hood, this uses the tool called create-next-app , which bootstraps a Next.js app for you.在后台,这使用了名为create-next-app的工具,它为您引导 Next.js 应用程序。 It uses this template through the --example flag.它通过--example标志使用此模板

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM