Composer plugin that uses front-end assets

Hi,

I have a composer plugin that has a bunch of javascript and css dependencies. The plugin itself enqueue’s the assets which is probably not the right way to do things (should be compiled into my gulp/bower workflow).

Any suggestions for how to handle this?

Thanks,
Jason

This is clearly plugin problem. In those situations I either choose good plugin or let it fly as it wants. In theme You can actually unregister css & js and insert Your own if it’s worth doing, otherwise - not so much.

I assume you’re talking about WordPress plugins that have some front-end dependencies they’re enqueueing. If you actually mean Composer projects, I’m not sure how they would incorporate any CSS/JS.

For WP plugins, it’s explained in detail in the Sage screencast, but the basic idea is to dequeue any scripts/styles and add them to your project’s build.

I’ve been running into this a lot as well. So called “lightweight” plugins. Especially any handy bootstrap customizers utilizing composer, gulp, bower with their own less compiler configurations. They just seem like to big of a headache for me to deal with.

I am surprised that there some of them hadn’t considered that some might already have a workflow established and implementing an entire separate workflow for a plugin isn’t appealing, and most of the time, not worth extending.

Yeah I ended up doing what kalen suggested before I even read his suggestion. Basically I just removed the plugins front end enqueue method from the sage init.php file. Then I manually added in the plugins it needed one-by-one via bower.

Thanks all,
Jason