tshamz / gulp-shopify-critical

turn critical css into a shopify snippet
9 stars 0 forks source link

Question: How do you guys handle image urls in critical? #2

Open code-mattclaffey opened 5 years ago

code-mattclaffey commented 5 years ago

Hey, I am using the same critical module to get the critical assets from my template and I was wondering how you guys worked around the following issue. So when my url to a font file in the css is ./fontname.woff2, the critical css outputs ../../../../../private/var/folders/49/n40jmhzj2s12z2jb_d6lnm1wj6mh26/T/fontName.woff2 which then causes a lot of 404s and warnings in the browser because it isn't the the right path. It should be {CDN}/path/to/fontName.woff2.

This is not an issue with the plugin more of a question around how that was solved? I did see you guys running tests on the preview url instead of the main url.

tshamz commented 5 years ago

I don't think this gulp plugin is being used anymore (tbh im not sure it ever was), but if i remember correctly, I never dealt with any font files. If you're building shopify themes, I'd consider dropping whatever build tool you're using and use slate instead. You can probably accomplish this what you're trying in a much simpler fashion with way better performance returns.