How modules should work with Public folder

Silverstripe Version:

I’ve upgraded to Silverstripe 4 and am serving all css, js and image assets from the public folder. The trouble is that extensions come with their own js and css, and my rewrite rules direct everything to public, so they can’t be found. I could copy them to public, or get rid of the rewrite rule, but neither option is very good. How do people usually deal with this?

If the module is written to support >4.1 then it should support the public directory functionality without the need for extra work.

A module can make any assets it needs publicly available by exposing them into the public directory. If you install the module with composer, this should happen automatically. Otherwise, you can run composer vendor-expose to re-run the ‘expose’ process.