Skip to content

Conversation

jamesmorrison
Copy link
Member

Description of the Change

Added: backwards compatible option to set file type; e.g.:

get_asset_info( 'css/file' )
get_asset_info( 'js/file' )
get_asset_info( 'blocks/file' )
get_asset_info( 'file' )

all work. If file type prefix is not specified, original order (JS, then CSS, then Blocks) is used.

Closes #13

How to test the Change

Run composer test; tests are included to ensure the file prefix is used where set.

Step-by-step:

  1. In the scaffold, enqueue an asset and use the prefixed path e.g. get_asset_info( 'css/file' )
  2. Run the build: npm install; npm run build
  3. Confirm the version and dependencies match

Changelog Entry

Added - backwards compatible option to set file type

Credits

Props @jamesmorrison

Checklist:

@jamesmorrison jamesmorrison added this to the 2.0.0 milestone Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to set file type in get_asset_info function

1 participant