Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

309
Visualizações
Gatsbyjs - Define Location of Static Pages as Something Other than the 'pages' folder

As the title states, I'm unsure if it is possible to customize the folder Gatsby looks into to generate static pages. Apparently, this seems to be fixed without the ability to change from the pages/ folder. Ideally, this could be changed with something like an environment variable or similar. On the existing docs (https://www.gatsbyjs.com/docs/creating-and-modifying-pages/) nothing like this is mentioned.

Does anybody know if this is possible and I've just missed it somewhere? I've also opened this feature request discussion on the Gatsby GitHub: https://github.com/gatsbyjs/gatsby/discussions/35727

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use the gatsby-plugin-page-creator (official plugin from Gatsby staff) to customize the source of the /pages folder. Simply use it as:

{
  resolve: `gatsby-plugin-page-creator`,
  options: {
    path: `${__dirname}/src/account/pages`,
  },
}

Or using environment files:

{
  resolve: `gatsby-plugin-page-creator`,
  options: {
    path: `${__dirname}/src/${process.env.A_FOLDER_NAME}`,
  },
}

You can even use multiple instances of the plugin or ignore some files with the ignore option.

I've tested it recently and worked like a charm.


The final configuration for this answer was:

{
  resolve: `gatsby-plugin-page-creator`,
  options: {
    path: `${__dirname}/src/pages`, 
    ignore: [`*`]     
  },
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda