{"id":15015896,"url":"https://github.com/simonihmig/ember-cli-bundle-analyzer","last_synced_at":"2026-05-08T16:01:57.730Z","repository":{"id":22611091,"uuid":"96824450","full_name":"simonihmig/ember-cli-bundle-analyzer","owner":"simonihmig","description":"Analyze the size and contents of your Ember app's bundles","archived":false,"fork":false,"pushed_at":"2023-07-18T21:20:33.000Z","size":5056,"stargazers_count":98,"open_issues_count":7,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-04-25T19:07:31.578Z","etag":null,"topics":["bundle-analyzer","bundlesize","ember","ember-addon","ember-cli","emberjs"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonihmig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-10T21:50:20.000Z","updated_at":"2026-01-19T13:39:52.000Z","dependencies_parsed_at":"2024-01-26T05:17:54.652Z","dependency_job_id":null,"html_url":"https://github.com/simonihmig/ember-cli-bundle-analyzer","commit_stats":{"total_commits":268,"total_committers":8,"mean_commits":33.5,"dds":0.4104477611940298,"last_synced_commit":"a3d094496f0ba764a13014d132f14e10f9ca3e93"},"previous_names":["kaliber5/ember-cli-bundle-analyzer","simonihmig/ember-cli-concat-analyzer"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/simonihmig/ember-cli-bundle-analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonihmig%2Fember-cli-bundle-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonihmig%2Fember-cli-bundle-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonihmig%2Fember-cli-bundle-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonihmig%2Fember-cli-bundle-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonihmig","download_url":"https://codeload.github.com/simonihmig/ember-cli-bundle-analyzer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonihmig%2Fember-cli-bundle-analyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32787235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle-analyzer","bundlesize","ember","ember-addon","ember-cli","emberjs"],"created_at":"2024-09-24T19:48:06.940Z","updated_at":"2026-05-08T16:01:57.710Z","avatar_url":"https://github.com/simonihmig.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ember-cli-bundle-analyzer\n\n![CI](https://github.com/simonihmig/ember-cli-bundle-analyzer/workflows/CI/badge.svg)\n[![Ember Observer Score](https://emberobserver.com/badges/ember-cli-bundle-analyzer.svg)](https://emberobserver.com/addons/ember-cli-bundle-analyzer)\n[![npm version](https://badge.fury.io/js/ember-cli-bundle-analyzer.svg)](https://badge.fury.io/js/ember-cli-bundle-analyzer)\n\nAn Ember CLI addon to analyze the size and contents of your app's bundled output, using an interactive zoomable treemap.\n\nView the [interactive Demo](https://raw.githack.com/simonihmig/ember-cli-bundle-analyzer/master/docs/demo.html)\n\n![Screenshot of analyzer output](docs/screen.png)\n\nThis helps you to\n\n- analyze which individual modules make it into your final bundle\n- find out how big each contained module is\n- find modules that got there by mistake\n- optimize your bundle size\n\nIt uses [source-map-explorer](https://github.com/danvk/source-map-explorer) under the hood,\nand wraps it in an Ember CLI addon to make it easy to use.\n\nGiven that it works based on source maps, it is agnostic to the actual bundling tool used, be it pure Ember CLI (which is based on `broccoli-concat`), Ember CLI with ember-auto-import (which makes it a mix of `broccoli-concat` and `webpack`) or even Embroider.\nThe only condition is that _proper_ source maps are generated.\n\n## Compatibility\n\n- Ember CLI v3.28 or above\n- Node.js v16 or above\n- works with ember-auto-import and Embroider, as long as source maps are properly enabled\n\n## Quick Start\n\nTo get you going _quickly_, follow these steps:\n\n1. Install the addon:\n\n   ```\n   ember install ember-cli-bundle-analyzer\n   ```\n\n2. Setup your `ember-cli-build.js`:\n\n   ```diff\n   const EmberApp = require('ember-cli/lib/broccoli/ember-app');\n   +const {\n   +  createEmberCLIConfig,\n   +} = require('ember-cli-bundle-analyzer/create-config');\n\n   module.exports = function (defaults) {\n     const app = new EmberApp(defaults, {\n       // your other options are here\n       // ...\n   +    ...createEmberCLIConfig(),\n     });\n\n     return app.toTree();\n   };\n   ```\n\n3. Launch your local server in analyze-mode:\n\n   ```sh\n   ENABLE_BUNDLE_ANALYZER=true ember serve --prod\n   ```\n\n4. Open [http://localhost:4200/\\_analyze](http://localhost:4200/_analyze)\n\nFor more detailed instructions, read the following chapters...\n\n## Setup\n\nTwo things need to be in place for this addon to work correctly: it needs to have a [config](#Config) that at least enables it, and _proper_ [source maps](#source-maps) need to be enabled for the EmberCLI build pipeline.\n\nWhile it is possible to provide these settings manually, the addon provides some recommended presets that you can apply using `createEmberCLIConfig`:\n\n```js\n// ember-cli-build.js\nconst EmberApp = require('ember-cli/lib/broccoli/ember-app');\nconst {\n  createEmberCLIConfig,\n} = require('ember-cli-bundle-analyzer/create-config');\n\nmodule.exports = function (defaults) {\n  const app = new EmberApp(defaults, {\n    // your other options are here\n    // ...\n    ...createEmberCLIConfig(),\n  });\n\n  return app.toTree();\n};\n```\n\nIf you are using Embroider, then this should cover you:\n\n```js\n// ember-cli-build.js\nconst EmberApp = require('ember-cli/lib/broccoli/ember-app');\nconst {\n  createEmberCLIConfig,\n  createWebpackConfig,\n} = require('ember-cli-bundle-analyzer/create-config');\n\nmodule.exports = function (defaults) {\n  const app = new EmberApp(defaults, {\n    // your other options are here\n    // ...\n    ...createEmberCLIConfig(),\n  });\n\n  return require('@embroider/compat').compatBuild(app, Webpack, {\n    // your Embroider options...\n    packagerOptions: {\n      webpackConfig: {\n        // any custom webpack options you might have\n        ...createWebpackConfig(),\n      },\n    },\n  });\n};\n```\n\nWith this config, when the environment variable `ENABLE_BUNDLE_ANALYZER` is set, it will enable the addon and apply required options to both Ember CLI and ember-auto-import to fully enable source maps with the required fidelity level.\n\n\u003e The reason the addon is not enabled by default is that it would be pointless if not having proper source maps fully enabled as well. And this might not be what you want by default, as generating full source maps comes at a cost of increased build times. On top of that you might also want to analyze the bundles only in production mode.\n\nNote that this might override some of your existing custom settings for source maps or ember-auto-import if you have those. So if that does not work for you, you can either try to deep merge the configs as in the following example, or provide your own explicit configs based of what [`createEmberCLIConfig` provides](./create-config.js).\n\n```js\n// ember-cli-build.js\nconst EmberApp = require('ember-cli/lib/broccoli/ember-app');\nconst {\n  createEmberCLIConfig,\n} = require('ember-cli-bundle-analyzer/create-config');\nconst { defaultsDeep } = require('ember-cli-lodash-subset');\n\nmodule.exports = function (defaults) {\n  const app = new EmberApp(\n    defaults,\n    defaultsDeep(\n      {\n        // your other options are here\n        // ...\n      },\n      createEmberCLIConfig()\n    )\n  );\n\n  return app.toTree();\n};\n```\n\n### Config\n\nYou can customize the precessing by setting any of the following configs into the `'bundleAnalyzer'` key of your\n`ember-cli-build.js`:\n\n- `enabled` (boolean): set to `true` to enable the addon. `false` by default.\n\n- `ignoreTestFiles` (boolean): by default it will exclude all test files from the output. Set this to `false` to include\n  them.\n\n- `ignore` (string | string[]): add files to ignore. Glob patterns are supported, e.g. `*-fastboot.js`.\n\n### Source maps\n\nThe bundle size output that you see coming from this addon can only be as good as the underlying source maps are. For [source-map-explorer](https://github.com/danvk/source-map-explorer) to correctly process those, they should have the full source code included inline (which is the `sourcesContent` field in a `.map` file).\n\nFor the `broccoli-concat` based part of Ember CLI (processing the app itself as well as all v1 addons), enabling source maps using `sourcemaps: { enabled: true },` in `ember-cli-config.js` will be enough.\nFor any `webpack` based build (be it ember-auto-import or Embroider), the default settings will _not_ be enough. The only setting that works reliably is enabling high-fidelity source maps using `devtool: 'source-map'`.\n\nAgain, for enabling source maps with the recommended options, using the `createEmberCLIConfig()` helper as mentioned above is recommended.\n\nFor further information consider these resources:\n\n- [Enabling source maps in Ember CLI](https://cli.emberjs.com/release/advanced-use/asset-compilation/#sourcemaps)\n- [Adding custom webpack config to ember-auto-import](https://github.com/ef4/ember-auto-import#customizing-build-behavior)\n- [Adding custom webpack config to Embroider](https://github.com/embroider-build/embroider#options)\n- [webpack's devtool](https://webpack.js.org/configuration/devtool/)\n\n## Usage\n\nYou need to have the addon and source maps enabled as described under [Setup](#setup). When following the recommended approach of using `createEmberCLIConfig` to apply the addon provided presets, then opting into the bundle-analyzer enabled mode is done by enabling the `ENABLE_BUNDLE_ANALYZER` environment flag when starting your local dev server. Most likely you will also want to analyze the production mode build, to exclude any debugging code. So the final invocation would be:\n\n```sh\nENABLE_BUNDLE_ANALYZER=true ember serve --prod\n```\n\nAfter startup this addon adds a custom middleware listening to the `/_analyze` URL path. So just open [http://localhost:4200/\\_analyze](http://localhost:4200/_analyze) in your web browser to access the analyzer output.\n\nWhile it processes the data a loading screen might appear, after which the final output should display.\n\nLive reloading is supported, so whenever you change a project file the output will be re-computed and updated automatically.\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonihmig%2Fember-cli-bundle-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonihmig%2Fember-cli-bundle-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonihmig%2Fember-cli-bundle-analyzer/lists"}