How to use webpack-stats-plugin - 10 common examples

To help you get started, we’ve selected a few webpack-stats-plugin 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 borela-tech / js-toolbox / src / configs / webpack / shared.js View on Github external
function configureBundleStats(config) {
  // Interactive tree map of the bundle.
  if (interactiveBundleStats)
    config.plugins.push(new BundleAnalyzerPlugin)

  // JSON file containing the bundle stats.
  if (bundleStats) {
    config.plugins.push(new StatsWriterPlugin({
      filename: 'bundle-stats.json',
      // Include everything.
      fields: null,
    }))
  }
}
github alleyinteractive / irving / packages / core / config / webpack / plugins.js View on Github external
// Ensures async components can be rendered sync server-side.
        new webpack.optimize.LimitChunkCountPlugin({
          maxChunks: 1,
        }),
      ];

    case 'production_client':
      return [
        ...commonPlugins,
        new CleanPlugin(),
        new webpack.EnvironmentPlugin({
          BUILD: true,
          BROWSER: true,
          ...env,
        }),
        new StatsWriterPlugin({
          stats: {
            all: false,
            assets: true,
            outputPath: true,
            publicPath: true,
          },
        }),
        // Support friendly stack traces for error reporting, but protect
        // source code from being exposed.
        new webpack.SourceMapDevToolPlugin({
          filename: 'static/js/[name].[chunkhash:8].map',
          noSources: true,
          publicPath: `${rootUrl}/`,
        }),
      ];
github auth0 / auth0-authorization-extension / build / webpack / config.prod.js View on Github external
},
    compress: {
      sequences: true,
      dead_code: true,
      conditionals: true,
      booleans: true,
      unused: true,
      if_return: true,
      join_vars: true,
      drop_console: true,
      warnings: false
    }
  }),

  // Alternative to StatsWriterPlugin.
  new StatsWriterPlugin({
    filename: 'manifest.json',
    transform: function transformData(data) {
      const chunks = {
        app: data.assetsByChunkName.app[0],
        style: data.assetsByChunkName.app[1],
        vendors: data.assetsByChunkName.vendors[0]
      };
      return JSON.stringify(chunks);
    }
  })
]);

module.exports = config;
github opencollective / opencollective-website / webpack.web.js View on Github external
const defaultFields = [
    'errors',
    'warnings',
    'version',
    'hash',
    'publicPath',
    'assetsByChunkName',
    'assets',
    'entrypoints',
    'chunks',
    'modules',
    'filteredModules',
    'children'
  ]

  config.plugins.push(new StatsWriterPlugin({
    // saves relative to the output path
    filename: 'stats.web.development.json',
    fields: fields || defaultFields
  }))
}
github redfin / react-server / packages / react-server-cli / src / webpack / webpack.config.fn.js View on Github external
resolveLoader: {
			root: [
				path.resolve(path.join(path.dirname(require.resolve("webpack")), "../..")),
			],
		},
		plugins: clean([
			longTermCaching && new webpack.optimize.OccurenceOrderPlugin(),
			new ChunkManifestPlugin({
				filename: "chunk-manifest.json",
				manifestVariable: "webpackManifest",
			}),
			new ExtractTextPlugin(`[name]${longTermCaching ? ".[chunkhash]" : ""}.css`),
			new webpack.optimize.CommonsChunkPlugin({
				name:"common",
			}),
			stats && new StatsPlugin.StatsWriterPlugin({
				fields: ["assets", "assetsByChunkName", "chunks", "errors", "warnings", "version", "hash", "time", "filteredModules", "children", "modules"],
			}),
			minify && new webpack.DefinePlugin({
				'process.env': {NODE_ENV: '"production"'},
			}),
			// TODO: should this be done as babel plugin?
			minify && new webpack.optimize.UglifyJsPlugin(),
			!minify && new webpack.SourceMapDevToolPlugin(),
			hot && new webpack.HotModuleReplacementPlugin(),
			hot && new webpack.NoErrorsPlugin(),
		]),
	};
}
github andrew-codes / catalyst-react / webpack.config.js View on Github external
new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin()
  );
} else if (config.__PROD__) {
  debug('Enable plugins for production (OccurenceOrder, Dedupe & UglifyJS).');
  webpackConfig.plugins.push(
    new webpack.optimize.OccurrenceOrderPlugin(),
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        unused: true,
        dead_code: true,
        warnings: false
      }
    }),
    new StatsWriterPlugin({
      chunkModules: true,
      filename: 'stats.json'
    })
  );
}

// ------------------------------------
// Pre-Loaders
// ------------------------------------
webpackConfig.module.preLoaders = [
  {
    test: /\.js$/,
    loader: 'eslint',
    exclude: /node_modules/
  }
];
github arleighdickerson / y2redux / build / webpack.config.js View on Github external
minify: {
      collapseWhitespace: true
    }
  })
]

if (__DEV__) {
  debug('Enable plugins for live development (HMR, NoErrors).')
  webpackConfig.plugins.push(
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin()
  )
} else if (__PROD__) {
  debug('Enable plugins for isomorphic rendering.')
  webpackConfig.plugins.unshift(
    new StatsWriterPlugin({
      filename: config.utils_paths.base('webpack-stats.json')
    }),
    new AssetsPlugin(),
    new IsomorphicTools({assets: {}})
  )
  debug('Enable plugins for production (OccurenceOrder, Dedupe & UglifyJS).')
  webpackConfig.plugins.push(
    new webpack.optimize.OccurrenceOrderPlugin(),
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        screw_ie8: true,
        unused: true,
        dead_code: true,
        warnings: false,
        drop_console: true
github FormidableLabs / redux-little-router / config / webpack / partials / stats.js View on Github external
module.exports = () =>
  plugin(
    new StatsWriterPlugin({
      filename: '../stats/stats.json'
    })
  );
github dmnsgn / frontend-boilerplate / config / plugins / utils.js View on Github external
__DEV__: JSON.stringify(NODE_ENV === "development"),
  __PRODUCTION__: JSON.stringify(NODE_ENV === "production")
});

const HMR = new webpack.HotModuleReplacementPlugin();

const hashedModuleIds = new webpack.HashedModuleIdsPlugin();

const banner = new webpack.BannerPlugin({
  banner: BANNER,
  raw: false,
  entryOnly: false,
  exclude: /\.svg$/
});

const buildInfo = new StatsWriterPlugin({
  filename: "stats.json"
});

export { define, HMR, hashedModuleIds, banner, buildInfo };
github auth0-extensions / auth0-sso-dashboard-extension / build / webpack / config.js View on Github external
sequences: true,
            dead_code: true,
            conditionals: true,
            booleans: true,
            unused: true,
            if_return: true,
            join_vars: true,
            drop_console: true,
            warnings: false
          }
        }
      })
    ];

    config.plugins.push(
      new StatsWriterPlugin({
        filename: 'manifest.json',
        transform: function transformData(data) {
          const chunks = {
            app: data.assetsByChunkName.app[0],
            style: data.assetsByChunkName.app[1],
            vendors: data.assetsByChunkName.vendor
          };
          return JSON.stringify(chunks);
        }
      })
    );


    config = extractCSS(config);
    break;
  case developmentMode:

webpack-stats-plugin

Webpack stats plugin

MIT
Latest version published 11 months ago

Package Health Score

75 / 100
Full package analysis

Popular webpack-stats-plugin functions