Follow-up

This commit is contained in:
Alexander Zinchuk 2023-03-30 20:29:00 -05:00
parent bd68352f98
commit 61a5ea2466

View File

@ -141,14 +141,14 @@ module.exports = (_env, { mode = 'production' }) => {
}, },
plugins: [ plugins: [
...(APP_ENV === 'staging' ? { ...(APP_ENV === 'staging' ? [{
apply: (compiler) => { apply: (compiler) => {
compiler.hooks.compile.tap('Before Compilation', async () => { compiler.hooks.compile.tap('Before Compilation', async () => {
const stats = await fetch(STATOSCOPE_REFERENCE_URL).then((res) => res.text()); const stats = await fetch(STATOSCOPE_REFERENCE_URL).then((res) => res.text());
fs.writeFileSync(path.resolve('./public/reference.json'), stats); fs.writeFileSync(path.resolve('./public/reference.json'), stats);
}); });
}, },
} : []), }] : []),
// Clearing of the unused files for code highlight for smaller chunk count // Clearing of the unused files for code highlight for smaller chunk count
new ContextReplacementPlugin( new ContextReplacementPlugin(
/highlight\.js[\\/]lib[\\/]languages/, /highlight\.js[\\/]lib[\\/]languages/,