Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
timnolte opened this issue Jun 11, 2024 · 1 comment
Open

Comments

@timnolte
Copy link

timnolte commented Jun 11, 2024

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.

@timnolte timnolte changed the title Generated ..asset.php Files Not Proper for Stylesheet Dependencies Generated .asset.php Files Not Proper for Stylesheet Dependencies Jun 11, 2024
@daotw
Copy link

daotw commented Sep 30, 2024

@timnolte in your example $asset['dependencies'] still doesn't work. We need it to work for dataviews and any React App in the admin area. In my links the authors use workarounds.

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

No branches or pull requests

2 participants