bertramdev / asset-pipeline

The core implementation of the asset pipeline for the jvm
194 stars 92 forks source link

asset-pipeline-spring-boot not rewriting relative URLs #228

Open kgeis opened 5 years ago

kgeis commented 5 years ago

I am using Font Awesome via webjar, and I have a src/assets/stylesheets/main.css with

/*
 *= require /webjars/font-awesome/5.3.1/css/all
 */

When I run it through ./gradlew assetCompile, the output contains

@font-face {
  font-family: 'Font Awesome 5 Free';
...
  src: ..., url("webjars/font-awesome/5.3.1/webfonts/fa-solid-900-14a08198ec7d1eb96d515362293fed36.woff2") format("woff2"), ...;
}

When I run the same project with ./gradlew bootRun, the development runtime generates a CSS file with

@font-face {
  font-family: 'Font Awesome 5 Free';
...
  src: ..., url("../webfonts/fa-solid-900.woff2") format("woff2"), ...;
}
davydotcom commented 5 years ago

This is not a bug. This is development runtime vs. production. bootRun is development runtime. If. You want to see it with the hash name you have to assemble a runnable fatJar or war

On Sep 18, 2018, at 7:38 PM, Ken Geis notifications@github.com wrote:

I am using Font Awesome via webjar, and I have a src/assets/stylesheets/main.css with

/ = require /webjars/font-awesome/5.3.1/css/all */ When I run it through ./gradlew assetCompile, the output contains

@font-face { font-family: 'Font Awesome 5 Free'; ... src: ..., url("webjars/font-awesome/5.3.1/webfonts/fa-solid-900-14a08198ec7d1eb96d515362293fed36.woff2") format("woff2"), ...; } When I run the same project with ./gradlew bootRun, the development runtime generates a CSS file with

@font-face { font-family: 'Font Awesome 5 Free'; ... src: ..., url("../webfonts/fa-solid-900.woff2") format("woff2"), ...; } — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bertramdev/asset-pipeline/issues/228, or mute the thread https://github.com/notifications/unsubscribe-auth/AABaEqaGhM8wWuUeI0Cn03kpZaDocZxjks5ucYPlgaJpZM4WvIT0.

kgeis commented 5 years ago

I don't care about the hash name. I want it to point to a location that's not a 404. webjars/font-awesome/5.3.1/webfonts/fa-solid-900.woff2 would be excellent.

On Sep 18, 2018, at 4:50 PM, David Estes notifications@github.com wrote:

This is not a bug. This is development runtime vs. production. bootRun is development runtime. If. You want to see it with the hash name you have to assemble a runnable fatJar or war

On Sep 18, 2018, at 7:38 PM, Ken Geis notifications@github.com wrote:

I am using Font Awesome via webjar, and I have a src/assets/stylesheets/main.css with

/ = require /webjars/font-awesome/5.3.1/css/all */ When I run it through ./gradlew assetCompile, the output contains

@font-face { font-family: 'Font Awesome 5 Free'; ... src: ..., url("webjars/font-awesome/5.3.1/webfonts/fa-solid-900-14a08198ec7d1eb96d515362293fed36.woff2") format("woff2"), ...; } When I run the same project with ./gradlew bootRun, the development runtime generates a CSS file with

@font-face { font-family: 'Font Awesome 5 Free'; ... src: ..., url("../webfonts/fa-solid-900.woff2") format("woff2"), ...; } — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bertramdev/asset-pipeline/issues/228, or mute the thread https://github.com/notifications/unsubscribe-auth/AABaEqaGhM8wWuUeI0Cn03kpZaDocZxjks5ucYPlgaJpZM4WvIT0.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bertramdev/asset-pipeline/issues/228#issuecomment-422596860, or mute the thread https://github.com/notifications/unsubscribe-auth/ACIjc71sJ70le9G41IVzhAQDMMdKl98rks5ucYaqgaJpZM4WvIT0.

davydotcom commented 5 years ago

Ah, how is your webjar defined in build dependencies.

On Sep 18, 2018, at 7:51 PM, Ken Geis notifications@github.com wrote:

I don't care about the hash name. I want it to point to a location that's not a 404. webjars/font-awesome/5.3.1/webfonts/fa-solid-900.woff2 would be excellent.

On Sep 18, 2018, at 4:50 PM, David Estes <notifications@github.com mailto:notifications@github.com> wrote:

This is not a bug. This is development runtime vs. production. bootRun is development runtime. If. You want to see it with the hash name you have to assemble a runnable fatJar or war

On Sep 18, 2018, at 7:38 PM, Ken Geis <notifications@github.com mailto:notifications@github.com> wrote:

I am using Font Awesome via webjar, and I have a src/assets/stylesheets/main.css with

/ = require /webjars/font-awesome/5.3.1/css/all */ When I run it through ./gradlew assetCompile, the output contains

@font-face { font-family: 'Font Awesome 5 Free'; ... src: ..., url("webjars/font-awesome/5.3.1/webfonts/fa-solid-900-14a08198ec7d1eb96d515362293fed36.woff2") format("woff2"), ...; } When I run the same project with ./gradlew bootRun, the development runtime generates a CSS file with

@font-face { font-family: 'Font Awesome 5 Free'; ... src: ..., url("../webfonts/fa-solid-900.woff2") format("woff2"), ...; } — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <https://github.com/bertramdev/asset-pipeline/issues/228 https://github.com/bertramdev/asset-pipeline/issues/228>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AABaEqaGhM8wWuUeI0Cn03kpZaDocZxjks5ucYPlgaJpZM4WvIT0 https://github.com/notifications/unsubscribe-auth/AABaEqaGhM8wWuUeI0Cn03kpZaDocZxjks5ucYPlgaJpZM4WvIT0>.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/bertramdev/asset-pipeline/issues/228#issuecomment-422596860 https://github.com/bertramdev/asset-pipeline/issues/228#issuecomment-422596860>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACIjc71sJ70le9G41IVzhAQDMMdKl98rks5ucYaqgaJpZM4WvIT0 https://github.com/notifications/unsubscribe-auth/ACIjc71sJ70le9G41IVzhAQDMMdKl98rks5ucYaqgaJpZM4WvIT0>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bertramdev/asset-pipeline/issues/228#issuecomment-422597144, or mute the thread https://github.com/notifications/unsubscribe-auth/AABaEnMFUaWYBFCLyRS5MQE0nFM_e9iXks5ucYb-gaJpZM4WvIT0.

kgeis commented 5 years ago
compile 'org.webjars:font-awesome:5.3.1'
kgeis commented 5 years ago

I forgot to mention: asset-pipeline-spring-boot 3.0.6