I see that those two files are automatically generated and put to dist.
const prodStatsJson = prodStats.toJson()
fs.outputFileSync(
path.join(config.paths.DIST, 'client-stats.json'),
JSON.stringify(prodStatsJson, null, 2)
)
fs.outputFileSync(
path.join(config.paths.DIST, 'bundle-environment.json'),
JSON.stringify(process.env, null, 2)
)
resolve(prodStatsJson)
client-stats.json can add a big and unnecessary overhead when you deploy the dist folder, while bundle-environment.json could possibly expose valuable info like npm_package_scripts_deploy.
Could we put those in some other place or disable auto generation?
Yes we can. Would you like to PR that change?
Done & Merged :)
I found a large client-stats.json remained in the dist folder after react-static build, using react-static v6.3.3.
Is there any configuration to remove client-stats.json to reduce the size of the dist folder?