chore: insert statistic into es (#35824)

This commit is contained in:
MadCcc 2022-05-31 16:44:55 +08:00 committed by GitHub
parent 9b95a30ec9
commit 4f6ebc944c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,5 +52,11 @@ ReactDOMServer.renderToString(React.createElement(Notification));
const libContent = await fs.readFile(libPath, 'utf8');
const newLibContent = `${libContent}\nexports._statistic_build_ = ${JSON.stringify(statistic)}`;
await fs.writeFile(libPath, newLibContent, 'utf8');
const esPath = `${process.cwd()}/es/_util/theme/util/statistic.js`;
const esContent = await fs.readFile(esPath, 'utf8');
const newEsContent = `${esContent}\nexport var _statistic_build_ = ${JSON.stringify(statistic)}`;
await fs.writeFile(esPath, newEsContent, 'utf8');
console.log(chalk.green(`✅ Collecting token statistics done.`));
})();