React-static: client-stats.json and bundle-environment.json

Created on 12 Jul 2018  路  3Comments  路  Source: react-static/react-static

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?

bug

All 3 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stefan-h-singer picture stefan-h-singer  路  3Comments

tomagladiator picture tomagladiator  路  3Comments

pbgms picture pbgms  路  3Comments

calvinrbnspiess picture calvinrbnspiess  路  4Comments

getDanArias picture getDanArias  路  4Comments