lein-cljsbuild icon indicating copy to clipboard operation
lein-cljsbuild copied to clipboard

Discussion: Using edn file for Closure-defines or cljs-build configuration

Open lxsameer opened this issue 7 years ago • 2 comments

Hi. In several different projects I had to use some sort of a build configuration for my cljs app to build it conditionally based on some data defined using closure-defines . But growth or this data caused a mess in my project.clj file and made my life hard.

I was thinking about adding a functionality to cljs-build plugin to support external configuration files. Either for all cljs-build configuration or just for closure-defines. So simply a configuration key with a file name or path as the value. The file should be in edn format and cljs-build should use the data inside that file and inject it to the built bundle.

I wanted to discuss this here before jumping in and implement the feature. What do you think folks? There is a good chance that I miss something and there are a solution for this problem before.

lxsameer avatar Oct 09 '17 15:10 lxsameer

Lein allows you to define and merge profiles, which seems like it would solve this problem, at least partially?

danielcompton avatar Oct 09 '17 19:10 danielcompton

Yeah somehow. But the problem I'm having is about writing a library which need it's configuration in a file. So expecting my user to copy paste some code in his/her project.clj might not be as simple as having a file just one entry like :configuration-file :foo/bar. It would makes the library author easier. Also I didn't mean clj build profiles. I mean cljs-build build profiles.

lxsameer avatar Oct 09 '17 19:10 lxsameer