简体   繁体   English

是否可以针对 Gatsby 项目中的特定更改运行构建?

[英]Is it possible to run a build for particular change in Gatsby Project?

When I run the build for Gatsby project it is taking more than 1.30 HR because of lot of lot of dynamic pages.当我为 Gatsby 项目运行构建时,由于有很多动态页面,它花费了超过1.30 HR My question is when I make a change on a particular page or pages Is it possible to run the build for the particular changes?我的问题是当我对一个或多个特定页面进行更改时是否可以针对特定更改运行构建?

For gatsby develop try using Gatsby flags .对于gatsby develop尝试使用Gatsby flags Used like this in the gatsby-config.js :gatsby-config.js中这样使用:

module.exports = {
  flags: {
    FAST_DEV: true,
  },
}

You can find a full detailed explanation of the current available flags at: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/flags.ts您可以在以下位置找到当前可用标志的完整详细说明: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/flags.ts

In your case, try using FAST_DEV which includes PRESERVE_FILE_DOWNLOAD_CACHE and DEV_WEBPACK_CACHE flags respectively.在您的情况下,请尝试使用分别包含PRESERVE_FILE_DOWNLOAD_CACHEFAST_DEV标志的DEV_WEBPACK_CACHE

For gatsby build I think you are looking for a feature called Incremental Builds: which basically only builds the pages that have changed from the last deployment.对于gatsby build ,我认为您正在寻找一种称为增量构建的功能:它基本上只构建自上次部署以来发生更改的页面。

Depending on your deploy server there's a different implementation way:根据您的部署服务器,有不同的实现方式:

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

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