When you run gatsby build (build time) there won’t be a browser available, so your site needs to be capable of protecting calls to browser based APIs. Instead, it starts up a development server that you can use to preview your site in the browser - like a runtime. The gatsby develop command doesn’t perform some of the production build steps that the gatsby build command does. Gatsby creates a JavaScript runtime that takes over in the browser once the initial HTML has loaded.īuild time, in contrast, refers to the process of using a server process to compile the site into files that can be delivered to a web browser later, so Browser APIs like window aren’t available at that time. JavaScript code can interact with the browser and take advantage of APIs it offers, such as window.location to get information from a page’s URL, using AJAX to submit a form, or injecting markup dynamically into the DOM. Processes that happen in a web browser that you click through and interact with can be referred to as a browser runtime. Build time vs runtimeĪ common confusion with the generation of static assets is the difference between build time and runtime. You can start Gatsby in either mode with its respective command: gatsby develop or gatsby build. Develop - run with the gatsby develop command.Gatsby has two modes for compiling a site: For more detailed information about specific steps, check out the Gatsby Internals section of the docs. This is a high-level overview about the steps in the Gatsby build process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |