Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Generated .asset.php Files Not Proper for Stylesheet Dependencies #14

@timnolte

Description

@timnolte

So no where can I find where the ...asset.php that are generated, and then used for Stylesheet dependencies, are actually appropriate. The dependencies arrays are generally always empty and actually seem to be generated only based on JavaScript import/use dependencies. The @wordpress/dependency-extraction-webpack-plugin is actually not designed for stylesheets and is designed for JavaScript files.

The main problem is that in so many examples stylesheets are setup like:

function themeslug_assets() {
	$asset = include get_theme_file_path( 'public/css/screen.asset.php' );

	wp_enqueue_style(
		'themeslug-style',
		get_theme_file_uri( 'public/css/screen.css' ),
		$asset['dependencies'],
		$asset['version']
	);
}

The problem here is that that $asset array values are not populated properly and we need to actually manage those manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions