How to use the webpack-bundle-analyzer.BundleAnalyzerPlugin function in webpack-bundle-analyzer

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 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'));
});
github ThaiProgrammer / tech-events-calendar / website / build / webpack.prod.conf.js View on Github external
webpackConfig.plugins.push(
    new CompressionWebpackPlugin({
      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')
  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

module.exports = webpackConfig
github Shopify / polaris-react / .storybook / webpack.config.js View on Github external
config.plugins.push({
    apply: (compiler) => {
      compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {
        spawn('yarn splash --show-disable-tip', {
          shell: true,
          stdio: 'inherit',
        });
      });
    },
  });

  config.module.rules = [config.module.rules[0], ...extraRules];

  if (isProduction) {
    config.plugins.push(
      new BundleAnalyzerPlugin({
        analyzerMode: 'static',
        reportFilename: path.resolve(
          __dirname,
          '../build/storybook/bundle-analysis/report.html',
        ),
        generateStatsFile: true,
        statsFilename: path.resolve(
          __dirname,
          '../build/storybook/bundle-analysis/stats.json',
        ),
        openAnalyzer: false,
      }),
    );
  }

  config.resolve.extensions.push('.ts', '.tsx');
github hyperstart / hyperstart.io / webpack.config.js View on Github external
module.exports = function(env) {
  const plugins = [
    new CleanWebpackPlugin(["public"]),
    new CopyWebpackPlugin([{ from: "assets", to: "" }]),
    new HtmlWebpackPlugin({
      filename: "./index.html",
      template: "./src/index.html"
    })
  ]
  let main
  if (env.build) {
    plugins.push(
      new BundleAnalyzerPlugin({
        analyzerMode: "static",
        openAnalyzer: false,
        reportFilename: "../reports/report.html"
      })
    )

    main = "./src/index.prod.ts"
  } else {
    main = "./src/index.dev.ts"
  }

  const configs = require("./config/" + env.target)
  plugins.push(new webpack.DefinePlugin(configs))

  return {
    mode: env.build ? "production" : "development",
github BelinChung / HiApp / 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

webpack-bundle-analyzer

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

MIT
Latest version published 7 months ago

Package Health Score

87 / 100
Full package analysis