UNPKG

@pnp/generator-spfx

Version:

This Yeoman generator helps organisations to improve their development workflow with the SharePoint Framework. It extends the functionalities of the @microsoft/generator-sharepoint based on best pattern and practices. This generator extends the capabiliti

25 lines (20 loc) 778 B
/** * Webpack Bundle Anlayzer * Reference and gulp task */ const bundleAnalyzer = require('webpack-bundle-analyzer'); build.configureWebpack.mergeConfig({ additionalConfiguration: (generatedConfiguration) => { const lastDirName = path.basename(__dirname); const dropPath = path.join(__dirname, 'temp', 'stats'); generatedConfiguration.plugins.push(new bundleAnalyzer.BundleAnalyzerPlugin({ openAnalyzer: false, analyzerMode: 'static', reportFilename: path.join(dropPath, `${lastDirName}.stats.html`), generateStatsFile: true, statsFilename: path.join(dropPath, `${lastDirName}.stats.json`), logLevel: 'error' })); return generatedConfiguration; } });