samaxes / minify-maven-plugin

Combine and minimize JavaScript and CSS files for faster page loading.
http://samaxes.github.com/minify-maven-plugin
Apache License 2.0
222 stars 91 forks source link

Relative paths in CSS and Maven minification? #143

Open Hemanshu1belani opened 7 years ago

Hemanshu1belani commented 7 years ago

The problem I have a workflow setup where maven combines and minifies multiple css files into one single file for a production environment.

The problem I'm facing is that font and image paths are breaking after running minification, as they're still pointing towards their existing relative file paths.

As an example:

Within static/homepage/startup/common-files/css/icon-font.css I have the following CSS rule:

@font-face{font-family:Flat-UI-Icons;src:url(../fonts/Startup-Icons.eot); In my pom, I specify that I want the output of my minified css file to be style.min.css located at static/css/custom/homepage/. The problem with this is that the filepath changes, resulting in all font and image dependencies to no longer be found and return a 404 status in the browser.

bakaibalazs commented 7 years ago

Hi! Is there any solution for rhis?

renanleandrof commented 6 years ago

no solution for this?