Bundle stats written to disk after running $ gulp bundle.
Bundle stats are not written to disk.
$ gulp bundleSame here, any news?
The Webpack plugin that was generating the stats was removed because of a license issue, but you're free to add it back yourself.
To add it back, install the webpack-bundle-analyzer package in your project (npm install webpack-bundle-analyzer --save-dev) and include this snippet in your gulpfile.js:
'use strict';
const gulp = require('gulp');
const path = require('path');
const build = require('@microsoft/sp-build-web');
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;
}
});
build.initialize(gulp);
You can find more information on extending the webpack configuration here.
I believe @chakkaradeep was going to write an article about how to do this specifically.
Thanks for clarification @iclanton. It would be helpful if this was communicated with the release of the generator.
@waldekmastykarz check https://www.npmjs.com/package/source-map-explorer ... I prefer this than the bloated one that was included before.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Most helpful comment
@waldekmastykarz check https://www.npmjs.com/package/source-map-explorer ... I prefer this than the bloated one that was included before.