Stats resolver function for Webpack
npm i @bipboys/webpack-stats-plugin
const {StatsWriterPlugin} = require('@bipboys/webpack-stats-plugin');
module = {
// webpack config
plugins: [
new StatsWriterPlugin({
filename: 'stats.json',
fields: [
'errors',
'warnings',
'assets',
'hash',
'publicPath',
'outputPath',
'namedChunkGroups'
]
})
]
};
import {getScripts} from '@bipboys/webpack-stats-plugin';
// Get Scripts and Links from stats.json
const {scriptsAssets, stylesAssets} = await getScripts(manifest, assetName);