Skip to content

Commit

Permalink
feat(gatsby): Only load gatsby-recipes in develop if Admin is enabled (
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed May 13, 2021
1 parent 060f732 commit 3ee94dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/gatsby-cli/src/create-cli.ts
Expand Up @@ -203,8 +203,11 @@ function buildLocalCommands(cli: yargs.Argv, isLocalSite: boolean): void {
`develop`,
(args: yargs.Arguments, cmd: (args: yargs.Arguments) => unknown) => {
process.env.NODE_ENV = process.env.NODE_ENV || `development`
const { startGraphQLServer } = require(`gatsby-recipes`)
startGraphQLServer(siteInfo.directory, true)

if (process.env.GATSBY_EXPERIMENTAL_ENABLE_ADMIN) {
const { startGraphQLServer } = require(`gatsby-recipes`)
startGraphQLServer(siteInfo.directory, true)
}

if (args.hasOwnProperty(`inspect`)) {
args.inspect = args.inspect || 9229
Expand Down

0 comments on commit 3ee94dc

Please sign in to comment.