PHPackages                             automattic/jetpack-assets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. automattic/jetpack-assets

ActiveJetpack-library[Utility &amp; Helpers](/categories/utility)

automattic/jetpack-assets
=========================

Asset management utilities for Jetpack ecosystem packages

v4.3.29(1mo ago)42.3M—2.4%320GPL-2.0-or-laterPHPPHP &gt;=7.2CI failing

Since Jun 21Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Automattic/jetpack-assets)[ Packagist](https://packagist.org/packages/automattic/jetpack-assets)[ RSS](/packages/automattic-jetpack-assets/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (207)Used By (20)

Jetpack Asset Management
========================

[](#jetpack-asset-management)

A package containing functionality to improve loading of assets (scripts, etc).

Includes manipulation of paths, enqueuing async scripts, and DNS resource hinting.

Usage
-----

[](#usage)

- `::get_file_url_for_environment( $min_path, $non_min_path, $package_path )` -- This is similar to `plugins_url()`, but chooses between `$min_path` and `$non_min_path` based on the constant `SCRIPT_DEBUG`. The filter `jetpack_get_file_for_environment` may be used to control the returned URL.
- `::add_resource_hint( $urls, $type )` -- Adds domains (string or array) to the WordPress' resource hinting. Accepts type of dns-prefetch (default), preconnect, prefetch, or prerender.
- `::normalize_path( $path )` -- Normalize `.` and `..` components in a path or URL.
- `::register_script( $handle, $path, $relative_to, $options )` -- Register a Webpack bundled script and styles using data produced by `@wordpress/dependency-extraction-webpack-plugin`. This replaces reading the `.asset.php` file and then making calls to `wp_register_script()`, `wp_register_style()` (with a potentially varying filename based on `is_rtl()`), and `wp_set_script_translations()`. See the inline documentation for details.
- `::enqueue_script( $handle )` -- Enqueue a script and style previously registered with `::register_script()`.
- `::alias_textdomains_from_file( $file )` -- Use data recorded by [automattic/jetpack-composer-plugin](https://packagist.org/packages/automattic/jetpack-composer-plugin) to enable use of translations for shared Composer libraries.
- `::alias_textdomains( $from, $to, $totype, $ver )` -- Manually add a textdomain alias, if for some reason `::alias_textdomains_from_file()` is insufficient.

The Assets package also provides a `wp-jp-i18n-loader` script to support Webpack lazy-loaded bundles using [@automattic/i18n-loader-webpack-plugin](https://www.npmjs.com/package/@automattic/i18n-loader-webpack-plugin). No initialization is required, other than calling `::alias_textdomains_from_file()` or `::alias_textdomains()` if said bundles are coming from shared Composer libraries.

Testing
-------

[](#testing)

```
$ composer run phpunit
```

Using this package in your WordPress plugin
-------------------------------------------

[](#using-this-package-in-your-wordpress-plugin)

If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security
--------

[](#security)

Need to report a security vulnerability? Go to  or directly to our security bug bounty site .

License
-------

[](#license)

jetpack-assets is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance89

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community39

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

188

Last Release

57d ago

Major Versions

v1.18.15 → v2.0.02023-11-20

v2.3.14 → v3.0.02024-11-14

v3.0.0 → v4.0.02024-11-25

PHP version history (2 changes)v2.0.0PHP &gt;=7.0

v3.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

![](https://www.gravatar.com/avatar/11609890f6e7a840715f4cfc9622d77ea64b7dfc024df5643fbf8471a18c00f3?d=identicon)[kraft](/maintainers/kraft)

![](https://www.gravatar.com/avatar/5326730499ec14e274f51b9bcc39db6aac0fb38b33849715aae0e2587a2b93df?d=identicon)[jeherve](/maintainers/jeherve)

![](https://www.gravatar.com/avatar/6e220e167e341c28b1aa10bf0bb0374999068329f8683d3187ee3cf6749b8837?d=identicon)[dereksmart](/maintainers/dereksmart)

---

Top Contributors

[![anomiex](https://avatars.githubusercontent.com/u/1030580?v=4)](https://github.com/anomiex "anomiex (212 commits)")[![tbradsha](https://avatars.githubusercontent.com/u/32492176?v=4)](https://github.com/tbradsha "tbradsha (59 commits)")[![jeherve](https://avatars.githubusercontent.com/u/426388?v=4)](https://github.com/jeherve "jeherve (37 commits)")[![kraftbj](https://avatars.githubusercontent.com/u/88897?v=4)](https://github.com/kraftbj "kraftbj (36 commits)")[![manzoorwanijk](https://avatars.githubusercontent.com/u/18226415?v=4)](https://github.com/manzoorwanijk "manzoorwanijk (31 commits)")[![zinigor](https://avatars.githubusercontent.com/u/374293?v=4)](https://github.com/zinigor "zinigor (27 commits)")[![coder-karen](https://avatars.githubusercontent.com/u/16754605?v=4)](https://github.com/coder-karen "coder-karen (24 commits)")[![samiff](https://avatars.githubusercontent.com/u/15803018?v=4)](https://github.com/samiff "samiff (21 commits)")[![gmjuhasz](https://avatars.githubusercontent.com/u/36671565?v=4)](https://github.com/gmjuhasz "gmjuhasz (15 commits)")[![sdixon194](https://avatars.githubusercontent.com/u/33553323?v=4)](https://github.com/sdixon194 "sdixon194 (12 commits)")[![ice9js](https://avatars.githubusercontent.com/u/8056203?v=4)](https://github.com/ice9js "ice9js (7 commits)")[![bindlegirl](https://avatars.githubusercontent.com/u/1242807?v=4)](https://github.com/bindlegirl "bindlegirl (5 commits)")[![dilirity](https://avatars.githubusercontent.com/u/11799079?v=4)](https://github.com/dilirity "dilirity (4 commits)")[![gogdzl](https://avatars.githubusercontent.com/u/37049295?v=4)](https://github.com/gogdzl "gogdzl (4 commits)")[![pablinos](https://avatars.githubusercontent.com/u/96462?v=4)](https://github.com/pablinos "pablinos (3 commits)")[![nateweller](https://avatars.githubusercontent.com/u/10933065?v=4)](https://github.com/nateweller "nateweller (3 commits)")[![chihsuan](https://avatars.githubusercontent.com/u/4344253?v=4)](https://github.com/chihsuan "chihsuan (3 commits)")[![adimoldovan](https://avatars.githubusercontent.com/u/3854374?v=4)](https://github.com/adimoldovan "adimoldovan (2 commits)")[![ArSn](https://avatars.githubusercontent.com/u/2803693?v=4)](https://github.com/ArSn "ArSn (2 commits)")[![dhasilva](https://avatars.githubusercontent.com/u/8486249?v=4)](https://github.com/dhasilva "dhasilva (2 commits)")

---

Tags

jetpack

### Embed Badge

![Health badge](/badges/automattic-jetpack-assets/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-jetpack-assets/health.svg)](https://phpackages.com/packages/automattic-jetpack-assets)
```

###  Alternatives

[automattic/jetpack

Jetpack supercharges your self‑hosted WordPress site with the awesome cloud power of WordPress.com

3621.9k](/packages/automattic-jetpack)[x-wp/di

The dependency injection container for WordPress

301.1k10](/packages/x-wp-di)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
