cljsjs / boot-cljsjs

Helper tasks to aid the packaging of JS dependencies for Clojurescript projects
66 stars 22 forks source link

Adding CSS (or other non-JS assets) #16

Closed peeb closed 6 years ago

peeb commented 9 years ago

I am trying to integrate [org.webjars/swiper "2.6.1"] into my boot project. This is a library that requires both a JS file and CSS file to operate.

I have the following lines in build.boot

(from-webjars :name "swiper/idangerous.swiper.js" :target "js/swiper.inc.js")
(from-webjars :name "swiper/idangerous.swiper.css" :target "css/swiper.css")

and boot produces the following output:

Adding META-INF/resources/webjars/swiper/2.6.1/idangerous.swiper.min.js to fileset
Adding META-INF/resources/webjars/swiper/2.6.1/idangerous.swiper.css to fileset

Yet the .css file does not show up in the resulting output files.

Is this expected? Is boot-cljsjs intended to just work with .js files?

martinklepsch commented 9 years ago

Hi Paul,

the from-* tasks add files to the fileset that is then passed to tasks in your build pipeline. These files are added as source files which means they are to tasks in the build pipeline but they won't show up in the target directory when all build steps are done (see https://github.com/boot-clj/boot/wiki/Filesets#fileset-components)

You can either write a task that picks up those files and adds them as resources or—probably best—you package it up as cljsjs package: https://github.com/cljsjs/packages.

Packaging it properly with externs will also allow you to compile your application in :advanced mode.

Feel free to ping me in #hoplon on Freenode if you need help with any of this.

peeb commented 9 years ago

OK, awesome. I'll take a stab at a doing a package.