簡體   English   中英

Gatsby 開發/構建時有什么方法可以顯示警告?

[英]Is there any way to show warnings when Gatsby develop/build?

我正在使用 React 進行 gatsby 項目。 當 gatsby development 或 gatsby build 時,我能夠看到所有警告,但控制台不再顯示警告。 我沒有更改任何與此相關的設置。 有誰知道如何解決這個問題? 謝謝你。

蓋茨比構建時的控制台

好吧,你應該改變任何東西。 可以是與 ESLint 配置相關的任何內容。

如果您在項目的根目錄中運行gatsby --help (或gatsby -h ),您將看到所有可用的命令,如下所示:

  gatsby develop                      Start development server. Watches files, rebuilds, and hot reloads if something changes
  gatsby build                        Build a Gatsby project.
  gatsby serve                        Serve previously built Gatsby site.
  gatsby info                         Get environment information for debugging and issue reporting
  gatsby clean                        Wipe the local gatsby environment including built assets and cache
  gatsby repl                         Get a node repl with context of Gatsby environment, see
                                      (https://www.gatsbyjs.com/docs/gatsby-repl/)
  gatsby recipes [recipe]             [EXPERIMENTAL] Run a recipe
  gatsby plugin <cmd> [plugins...]    Useful commands relating to Gatsby plugins
  gatsby new [rootPath] [starter]     Create new Gatsby project.
  gatsby telemetry                    Enable or disable Gatsby anonymous analytics collection.
  gatsby options [cmd] [key] [value]  View or set your gatsby-cli configuration settings.

Options:
  --verbose                Turn on verbose output                                                       [boolean] [default: false]
  --no-color, --no-colors  Turn off the color in output                                                 [boolean] [default: false]
  --json                   Turn on the JSON logger                                                      [boolean] [default: false]
  -h, --help               Show help                                                                                     [boolean]
  -v, --version            Show the version of the Gatsby CLI and the Gatsby package in the current project              [boolean]

因此,您可以運行:

gatsby develop --verbose

打開詳細的 output 並查看詳細日志。

正如我所說,您需要區分瀏覽器的日志和 Node 終端日志,瀏覽器會提示一些日志(客戶端日志),關於 React 和 JavaScript 的所有內容。 雖然其他一些(服務器端日志)只會由終端提示,但這些是指與 Node、GraphQL 等相關的內容。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM