![]() ![]() When something is updated and the script is re-run, the hash in the filename will change, so the new filename won't be cached and the browser will know to fetch it. To break the cache, the resource's URL needs to change. If the resource is in the browser's cache, the browser won't even make a request for it. The HTML is processed to update the references to the assets new hash-based filenames.Īll of this means that we can serve the site with far-future Expires headers.References to these file in CSS and JS are updated.Binary files are versioned with hashes in the file names.build directory and runs it through various optimizations.ĭuring these optimizations, the following takes place: Then a 3rd asset-pipeline process initiates and takes the the built content from. The Eleventy process and the JS and CSS builds happen in series. Production buildsīuilding for production is slightly different. For automatic reloading of the JS and CSS, each script uses a fetch to the public API to tell browserSync there is new code and it reloads it for you. In development Eleventy knows nothing about the CSS and JavaScript builds. When something changes the site is re-built. Once up and running both eleventy and the JS and CSS build scripts watch for changes. When you run yarn start the CSS and JS is built in parallel with the eleventy build. The site works in slightly different ways depending on whether you're running the site for local development or building the site for production. ![]() The site is built with Eleventy, a NodeJS-based static site generator. (You probably won't need to use this manually.) Starts eleventy and includes unpublished content.īuilds the site for production with unpublished content.Ĭlears the output directory. Content with published: false will not be available on staging or production. ℹ️ NOTE: Running locally will show unpublished content that uses the published: false convention in frontmatter. ![]()
0 Comments
Leave a Reply. |