webjars / webjars-play

MIT License
80 stars 34 forks source link

Handle webjars that are now available via CDN #57

Closed muuki88 closed 9 years ago

muuki88 commented 9 years ago

I have two webjar dependencies

that are not available via JsDeliver CDN. Causing the rjs stage to fail with

[info] JavaScript linting on 1 source(s)
[info] Optimizing JavaScript with RequireJS
[info] Error: Error: paths fallback not supported in optimizer. Please provide a build config path override for nvd3

or

[info] JavaScript linting on 1 source(s)
[info] Optimizing JavaScript with RequireJS
[info] Error: Error: paths fallback not supported in optimizer. Please provide a build config path override for angular-nvd3

is there a way to deactive CDN replacement for certain webjar dependencies?

muuki88 commented 9 years ago

I fixed this by setting the CDNs to an empty map. I think I have to match for certain strings to another CDN if I want to use them.

set RjsKeys.webJarCdns := Map.empty
jamesward commented 9 years ago

The files should have been available on the CDN. Maybe this is related to #1206. Did you get an error?

muuki88 commented 9 years ago

Only the one I posted in the issue description. I couldn't find the files in the CDN either. The resulting appBuild.js didn't contain the dependencies (that caused the error in requirejs)

jamesward commented 8 years ago

Could you tell what URLs were being used?

muuki88 commented 8 years ago

Sorry that it took me so long. I found the proper solution. The CDNs check for the artifact-name. So adding

RjsKeys.webJarCdns += ("org.webjars.bower" -> "//cdn.jsdelivr.net/webjars")
RjsKeys.webJarCdns += ("org.webjars.npm" -> "//cdn.jsdelivr.net/webjars")

to your build.sbt helps sbt-rjs to find the correct CDN jars ;)