Meta tags:
description= npm run build creates a build directory with a production build of your app. Inside the build/static directory will be your JavaScript and CSS files. Each filename inside of build/static will contain a unique hash of the file contents. This hash in the file name enables long term caching techniques.;
Headings (most frequently used words):
creating, production, build, static, file, caching, profiling,
Text of the page (most frequently used words):
the (30), build (21), your (14), static (12), file (11), this (11), will (11), for (9), and (9), code (9), app (9), you (8), cache (8), hash (8), react (7), production (7), that (7), application (7), #profiling (6), contents (6), caching (5), using (5), files (5), control (5), create (5), adding (5), performance (4), can (4), assets (4), browser (4), filename (4), index (4), html (4), directory (4), chunk (4), vendor (4), github (3), docs (3), additional (3), opt (3), use (3), profile (3), run (3), one (3), well (3), with (3), each (3), inside (3), generated (3), which (3), techniques (3), chunks (3), splitting (3), main (3), creating (3), started (2), running (2), measuring (2), updated (2), page (2), development (2), mode (2), since (2), small (2), enable (2), see (2), npm (2), year (2), embedded (2), best (2), header (2), within (2), allows (2), time (2), unique (2), changes (2), load (2), advanced (2), runtime (2), them (2), long (2), term (2), number (2), are (2), variables (2), copyright, 2025, facebook, inc, social, contributor, covenant, twitter, discussions, stack, overflow, community, learn, get, tests, next, previous, last, jacob, evans, 2019, edit, reactdom, automatically, supports, v16, but, adds, some, overhead, flag, details, about, devtools, yarn, everything, else, safe, effective, starting, point, ensures, user, always, check, all, note, expiration, safely, because, into, max, age, 31536000, deliver, users, practice, specify, length, cdns, aren, familiar, what, does, great, introduction, article, have, appended, based, avoid, downloading, haven, changed, subsequent, different, aggressive, split, folder, logic, used, default, save, network, request, out, specifying, documented, our, instead, embedding, configuration, inline_runtime_chunk, false, webpack, these, either, includes, modules, imported, from, potential, advantages, improve, loading, tends, change, less, often, than, actual, able, separately, won, download, node_modules, etc, when, freshly, created, there, called, placed, creates, javascript, css, contain, name, enables, support, usage, deployment, back, end, integration, testing, making, progressive, web, environment, router, relay, typescript, flow, bootstrap, global, importing, component, installing, dependency, building, styles, getting, welcome, search, help, deprecated, read, more, here, skip, content,
Text of the page (random words):
creating a production build create react app skip to main content create react app is deprecated read more here create react app docs help github search k welcome getting started development styles and assets building your app installing a dependency importing a component using global variables adding bootstrap adding flow adding typescript adding relay adding a router environment variables making a progressive web app measuring performance creating a production build testing back end integration deployment advanced usage support on this page creating a production build npm run build creates a build directory with a production build of your app inside the build static directory will be your javascript and css files each filename inside of build static will contain a unique hash of the file contents this hash in the file name enables long term caching techniques when running a production build of freshly created create react app application there are a number of js files called chunks that are generated and placed in the build static js directory main hash chunk js this is your application code app js etc number hash chunk js these files can either be vendor code or code splitting chunks vendor code includes modules that you ve imported from within node_modules one of the potential advantages with splitting your vendor and application code is to enable long term caching techniques to improve application loading performance since vendor code tends to change less often than the actual application code the browser will be able to cache them separately and won t re download them each time the app code changes runtime main hash js this is a small chunk of webpack runtime logic which is used to load and run your application the contents of this will be embedded in your build index html file by default to save an additional network request you can opt out of this by specifying inline_runtime_chunk false as documented in our advanced configuration which will load this chunk instead of embedding it in your index html if you re using code splitting to split up your application this will create additional chunks in the build static folder as well static file caching each file inside of the build static directory will have a unique hash appended to the filename that is generated based on the contents of the file which allows you to use aggressive caching techniques to avoid the browser re downloading your assets if the file contents haven t changed if the contents of a file changes in a subsequent build the filename hash that is generated will be different to deliver the best performance to your users it s best practice to specify a cache control header for index html as well as the files within build static this header allows you to control the length of time that the browser as well as cdns will cache your static assets if you aren t familiar with what cache control does see this article for a great introduction using cache control max age 31536000 for your build static assets and cache control no cache for everything else is a safe and effective starting point that ensures your user s browser will always check for an updated index html file and will cache all of the build static files for one year note that you can use the one year expiration on build static safely because the file contents hash is embedded into the filename profiling reactdom automatically supports profiling in development mode for v16 5 but since profiling adds some small additional overhead it is opt in for production mode you can opt in by using the profile flag use npm run build profile or yarn build profile to enable profiling in the production build see the react docs for details about profiling using the react devtools edit this page last updated on 10 2 2019 by jacob m g evans previous measuring performance next running tests static file caching profiling docs get started learn react community stack overflow github discussions twitter contributor covenant social github copyright 2025 facebook inc
|