🤔 무엇을
pages 디렉토리는 기본 설정대로 src하위 디렉토리로 설정되어있다. 하지만 folder structure를 커스텀하게 변경하고싶다.
🔑 Solution
module.exports = {
plugins: [
// You can have multiple instances of this plugin
// to create pages from React components in different directories.
//
// The following sets up the pattern of having multiple
// "pages" directories in your project
{
resolve: `gatsby-plugin-page-creator`,
options: {
path: `${__dirname}/src/account/pages`,
},
},
{
resolve: `gatsby-plugin-page-creator`,
options: {
path: `${__dirname}/src/settings/pages`,
},
},
],
}
위와 같은 방식으로 페이지를 불러오는 곳의 디렉토리를 변경 할 수 있다.