As far as I know /dist
is for production environments. It contains uglified and similar files. But why do we need a /build
folder ?
What is the difference between build and dist folder?
Asked Answered
Dist is for distribution and contains minified code. Build contains code that is not minified and not ready for production deployment.
Check this link… What is the role of src and dist folders?
But create-react-app builds into
build
by default and that code is minified, right? –
Ommiad Dist is stores all the files and folders that are required to host on server. Build is the final built package of files that will be deployed somewhere.
As Mentioned above Build is the final outcome of the files wrapped in a package which is used while hosting the site but the catch is the build
also minifies the whole production packages and only keeps modules that is necessary for running.
© 2022 - 2025 — McMap. All rights reserved.
path: process.env.NODE_ENV === 'production' ? './dist' : './build','
it seems they are different – Grin