ProjectEvergreen / greenwood

Greenwood is your full-stack workbench for the web, focused on supporting modern web standards and development to help you create your next project.
https://www.greenwoodjs.io
MIT License
95 stars 9 forks source link

support bundling of `url` properties (like for `@font-face` + `src`) during CSS file optimization #1199

Closed thescientist13 closed 2 months ago

thescientist13 commented 5 months ago

Summary

As observed in https://github.com/ProjectEvergreen/www.greenwoodjs.dev/pull/9, it appears that certain URL based CSS features are not bundling (like we do with @import), like in this example for @font-face, which will just yield a 404 in production builds.

 <style>
   @font-face {
     font-family: "Geist-Sans";
     src: url('../../node_modules/geist/dist/fonts/geist-sans/Geist-Regular.woff2') format("truetype");
   }
 </style>

Details

This should bundle (e.g. copy) the file into the build output automatically for @font-face references and ideally thing else that is of type Url