Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Webpack Stats

Webpack Stats Laravel Package

freshheads/webpack-stats

A Laravel package that surfaces Webpack build statistics inside your PHP application, letting you inspect asset bundles, compilation output, and manifest data without leaving the backend. Useful for debugging front-end builds and keeping asset references in sync.

View on GitHub
Deep Wiki
Context7

A PHP library to read the Webpack statistics file.

Frequently asked questions about Webpack Stats
What does freshheads/webpack-stats do in a Laravel application?
It is a Laravel package that reads the statistics output produced by a Webpack build and turns that data into usable PHP structures inside your application. That gives your backend access to compiled asset names, entrypoint and chunk information, and build metadata. The practical benefit is that server-rendered Blade views can reference the correct hashed filenames without hardcoding them or duplicating manifest parsing logic.
How do I install freshheads/webpack-stats?
It is distributed as a Composer package, so installation is done through Composer in the root of your Laravel project. Run composer require freshheads/webpack-stats and let Laravel's package discovery register the service provider. After that, point the package at your Webpack stats or manifest output and you can start resolving asset paths from PHP.
How do I get hashed asset filenames into my Blade templates?
The package exposes an API that resolves a logical asset name to its compiled, hashed filename from the Webpack stats data. You can call that resolver from a controller, a view composer, or a Blade helper so templates output the same file that was actually emitted by the build. This avoids stale hardcoded paths and keeps cache-busting hashes correct after every deployment.
Where does the package look for the Webpack stats file?
The package reads the stats or manifest output generated by your Webpack build, so the file needs to exist in your project or deployment artifact before PHP tries to resolve assets. In a typical setup you generate stats during the production build step and ship the resulting file with your release. Check the package configuration for the exact path and adjust it to match where your Webpack output lands.
Which Laravel versions are supported?
Laravel version compatibility is defined by the package's composer.json constraints, so check those before installing into an older or very new application. Because the package is described as framework-friendly and integrates through Laravel's standard package conventions, it fits the normal install flow, but the authoritative answer is always the Composer constraints for the release you are pulling. If you are upgrading Laravel, verify the constraint allows your target version first.
Is this a replacement for Laravel Mix or Vite's manifest handling?
Not necessarily. Laravel Mix and Vite ship their own manifest helpers, and if you are already on one of those toolchains you may not need an extra package. freshheads/webpack-stats is aimed at projects with a raw Webpack setup that want stats and chunk data available in PHP, including entrypoint information that simple manifest helpers do not expose. It is best treated as an alternative or complement rather than a drop-in replacement.
Can I inspect chunk and entrypoint information from PHP?
Yes, exposing chunk and entrypoint information is one of the package's stated capabilities. That means you can look at how Webpack grouped modules and which entrypoints reference which assets, from inside your Laravel code. This is useful when debugging build output, prefetching the right files, or building custom asset-loading logic.
Is it safe to use in production?
Reading a stats file at runtime is lightweight compared with running a build, but the file must exist and be readable in your deployed environment. Generate the stats as part of your build pipeline and include it in the release artifact rather than generating it on the server. If you are concerned about per-request file reads, resolve the asset paths once and cache the results.
Do I need a real Webpack build to test this package?
You need some Webpack stats or manifest output for the resolver to read, but it does not have to come from a full production build. A fixture file committed to your test suite is usually enough to assert that asset names and chunk data resolve correctly. That keeps tests fast and deterministic while still exercising the parsing logic your application relies on.
Who maintains freshheads/webpack-stats and how do I report issues?
It is published by Freshheads as a Composer package, so the repository and issue tracker linked from the Packagist entry are the right place to report bugs or ask questions. Before filing, confirm the behavior against your installed version and include your Webpack stats sample, since parsing problems are usually data-specific. If the package appears unmaintained, pinning your installed version in composer.json is a sensible precaution.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource