DefinitelyTyped/types/webpack-bundle-analyzer/webpack-bundle-analyzer-tests.ts
Max Boguslavsky 9c7a0a6262 Webpack bundle analyzer update (#38344)
* added test and updated interface

* added test and updated interface

* reformatted spaces

* - reformatted code
2019-09-19 12:17:29 -07:00

34 lines
965 B
TypeScript

import * as webpack from 'webpack';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
const config: webpack.Configuration = {
plugins: [
new BundleAnalyzerPlugin(),
new BundleAnalyzerPlugin({
analyzerMode: 'static',
}),
new BundleAnalyzerPlugin({
analyzerPort: 'auto',
}),
new BundleAnalyzerPlugin({
analyzerMode: 'server',
analyzerHost: '127.0.0.1',
analyzerPort: 8888,
reportFilename: 'report.html',
defaultSizes: 'parsed',
openAnalyzer: true,
generateStatsFile: true,
statsFilename: 'stats.json',
statsOptions: {
source: false,
},
excludeAssets: [
'foo',
/foo/,
assetName => assetName.indexOf('foo') !== -1,
],
logLevel: 'info',
}),
],
};