neos / flow-development-collection

The unified repository containing the Flow core packages, used for Flow development.
https://flow.neos.io/
MIT License
138 stars 188 forks source link

Rewrite URLs in CSS files #520

Open neos-bot opened 9 years ago

neos-bot commented 9 years ago

Jira issue originally created by user @robertlemke:

CSS files (and probably other types of assets) may contain relative or absolute URLs pointing to other resources – such as web fonts or images. Publishing theses assets as they are will result in broken links when using a CDN. Neos / Flow must replace the URLs to correct absolute URLs pointing to the CDN servers.

Jira-URL: https://jira.neos.io/browse/FLOW-115

neos-bot commented 9 years ago

Comment created by @bwaidelich:

Sounds like a feature to me.. Are there (easy) ways around or do we have to consider this a blocker?

sorenmalling commented 4 years ago

@robertlemke I believe this a covered by todays build tools (webpack, grunt etc) and is not considered a nescessary core functionality of Flow.

Can I close this ticket?

albe commented 4 years ago

Yes that's manually doable with build tools, but maybe we can still improve the developer experience a bit? Maybe a documentation section on how to properly adjust URIs during/after the publishing process with those tools, while keeping generic/relative URIs in your assets?

sorenmalling commented 4 years ago

Maybe a documentation section on how to properly adjust URIs during/after the publishing process with those tools

I'm all ear - do you mean the Flows own publishing mechanis or build tools such from "outside" Flow?

bwaidelich commented 4 years ago

Aren't resource URIs absolute anyways in Flow?

sorenmalling commented 4 years ago

Aren't resource URIs absolute anyways in Flow?

If created with ex ResourceViewHelper and hence the ResourceManager, yes it's absolute

albe commented 4 years ago

Yes, but say you have a css file in your assets that contains an URI background: url(/some/other/path/to/some/image.jpg) and now you publish this css to a CDN via Flows resource:publish command, then the URI will no longer work (unless you end up with the exact same path to the image.jpg on that CDN, which is unlikely).

sorenmalling commented 4 years ago

This is more a topic of configuring your build tools and deployment setup, right? Can we call this a potential documentation topic? Maybe even a good documentation topic for Neos CMS integrators?