JSPM

  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q40260F
  • License MIT

Plugin for @ima/cli adding analyze bundle functionality.

Package Exports

  • @ima/cli-plugin-analyze
  • @ima/cli-plugin-analyze/dist/cjs/main.js
  • @ima/cli-plugin-analyze/dist/esm/main.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ima/cli-plugin-analyze) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@ima/cli-plugin-analyze

Pre-configures bundle-stats-webpack-plugin and webpack-bundle-analyzer webpack plugins for fast and easy bundle analyzing.

Installation

npm install @ima/cli-plugin-analyze -D

Usage

const { AnalyzePlugin } = require('@ima/cli-plugin-analyze');

/**
 * @type import('@ima/cli').ImaConfig
 */
module.exports = {
  plugins: [new AnalyzePlugin()],
};

CLI Arguments

--analyze

client | client.es | server

Run the ima build command with --analyze argument and pick one of the three produced bundles you want to analyze. For example: npx ima build --analyze=client.

Options

new AnalyzePlugin(options: {
  open?: boolean;
  bundleStatsOptions?: BundleStatsWebpackPlugin.Options;
  bundleAnalyzerOptions?: BundleAnalyzerPlugin.Options;
});

open

boolean = true

Set to false if you don't want to automatically open the browser window with the html reports when the build finishes.

bundleStatsOptions

object

Pass any option that the BundleStatsWebpackPlugin accepts. These are then merged with some of our custom defaults.

bundleAnalyzerOptions

object

Pass any option that the BundleAnalyzerPlugin accepts. These are then merged with some of our custom defaults.


For more information, take a look at the IMA.js documentation.