Creating production build
To create a production build of your theme, you must run the build command:
npm run build
This creates a
builddirectory with a production build of your app. Inside the
build/staticwill 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
.jsfiles (called chunks) that are generated and placed in the
- This is your application code.
- These files are vendor chunks. The code inside them includes modules that you've imported from within
node_modules. 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.
- 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.htmlfile by default to save an additional network request.
.cssfiles (called chunks) that are generated and placed in the
- These files are vendor chunks. The code inside them includes CSS modules that you've imported from within
- This are styles imported in your application.