How to use webpack-bundle-analyzer - 10 common examples

To help you get started, we’ve selected a few webpack-bundle-analyzer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github geekape / applet-h5-shop / mpvue / weiapp / build / webpack.prod.conf.js View on Github external
module.resource.indexOf('node_modules') >= 0
        ) || count > 1
      }
    }),
    // extract webpack runtime and module manifest to its own file in order to
    // prevent vendor hash from being updated whenever app bundle is updated
    new webpack.optimize.CommonsChunkPlugin({
      name: 'common/manifest',
      chunks: ['common/vendor']
    }),
  ]
})

if (config.build.bundleAnalyzerReport) {
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

module.exports = webpackConfig
github Automattic / wp-calypso / bin / icfy-analyze.js View on Github external
function analyzeBundle() {
	console.log( 'Analyze: reading stats.json file' );
	const stats = readStatsFromFile( 'stats.json' );
	console.log( 'Analyze: analyzing' );
	const chart = getViewerData( stats, './public/evergreen' );
	console.log( 'Analyze: writing chart.json file' );
	writeFileSync( 'chart.json', JSON.stringify( chart, null, 2 ) );
	console.log( 'Analyze: analyzing the style.css file' );
	analyzeStylesheet( './public/style.css', 'style.json' );
	console.log( 'Analyze: finished' );
}
github GDJiaMi / jm-cli / src / cmds / analyze.ts View on Github external
return
    }

    if (stats.hasErrors()) {
      spinner.stopAndPersist({ text: 'Failed to compile.\n\n', symbol: logSymbols.error })
      const messages = formatMessages(stats)
      if (messages.errors.length) {
        messages.errors.forEach(e => console.log(e))
      }
      return
    }

    const port = await choosePort(8888)

    const json = stats.toJson()
    analyzer.start(json, { port })

    await fs.writeJSON(path.join(paths.appDist, 'stat.json'), json)

    spinner.stopAndPersist({ text: 'Extract successfully.', symbol: logSymbols.success })
  })
}
github Automattic / wp-calypso / bin / icfy-analyze.js View on Github external
function analyzeBundle() {
	console.log( 'Analyze: reading stats.json file' );
	const stats = readStatsFromFile( 'stats.json' );
	console.log( 'Analyze: analyzing' );
	const chart = getViewerData( stats, './public/evergreen' );
	console.log( 'Analyze: writing chart.json file' );
	writeFileSync( 'chart.json', JSON.stringify( chart, null, 2 ) );
	console.log( 'Analyze: analyzing the style.css file' );
	analyzeStylesheet( './public/style.css', 'style.json' );
	console.log( 'Analyze: finished' );
}
github learningequality / kolibri / packages / kolibri-tools / lib / bundleStats.js View on Github external
const compiler = webpack(bundle, (err, stats) => {
    if (stats.hasErrors()) {
      buildLogging.error(`There was a build error for ${bundle.name}`);
      process.exit(1);
    } else {
      const port = options.port + 1 + index;
      viewer.startServer(stats.toJson(), {
        openBrowser: false,
        port,
      });
    }
  });
  compiler.hooks.compile.tap('Process', startCallback);
github zwhGithub / vue-calendar / build / webpack.prod.conf.js View on Github external
asset: '[path].gz[query]',
      algorithm: 'gzip',
      test: new RegExp(
        '\\.(' +
        config.build.productionGzipExtensions.join('|') +
        ')$'
      ),
      threshold: 10240,
      minRatio: 0.8
    })
  )
}

if (config.build.bundleAnalyzerReport) {
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

module.exports = webpackConfig
github LazyNeo / vue-oss-uploader / build / webpack.npm.conf.js View on Github external
asset: '[path].gz[query]',
      algorithm: 'gzip',
      test: new RegExp(
        '\\.(' +
        config.build.productionGzipExtensions.join('|') +
        ')$'
      ),
      threshold: 10240,
      minRatio: 0.8
    })
  )
}

if (config.build.bundleAnalyzerReport) {
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
webpackConfig.entry = {
  app: './src/npm.js'
}
module.exports = webpackConfig
github laden666666 / my-picker / docs-src / build / webpack.prod.conf.js View on Github external
asset: '[path].gz[query]',
      algorithm: 'gzip',
      test: new RegExp(
        '\\.(' +
        config.build.productionGzipExtensions.join('|') +
        ')$'
      ),
      threshold: 10240,
      minRatio: 0.8
    })
  )
}

if (config.build.bundleAnalyzerReport) {
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

module.exports = webpackConfig
github sekl / node-vue-phaser-boilerplate / build / webpack.prod.conf.js View on Github external
asset: '[path].gz[query]',
      algorithm: 'gzip',
      test: new RegExp(
        '\\.(' +
        config.build.productionGzipExtensions.join('|') +
        ')$'
      ),
      threshold: 10240,
      minRatio: 0.8
    })
  )
}

if (config.build.bundleAnalyzerReport) {
  var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

module.exports = webpackConfig
github patternfly-webcomponents / patternfly-webcomponents / gulpfile.js View on Github external
gulp.task('webpack', ['js'], function () {
  var webpackConfig = require('./webpack.config.js');
  if (runBundleAnalyzer) {
    webpackConfig.plugins.push(new BundleAnalyzerPlugin());
  }
  return gulp.src('src/patternfly.js')
    .pipe(webpackStream(webpackConfig, webpack))
    .pipe(gulp.dest('dist/js'));
});

webpack-bundle-analyzer

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap

MIT
Latest version published 8 months ago

Package Health Score

86 / 100
Full package analysis