Using scalajs, I think sbt-buildinfo is the perfect solution for incorporating compile-time environment overrides. For instance, webpack has the DefinePlugin which injects global vars as environment-specific overrides (e.g. to compile with either dev/qa/prod hostnames). But global vars is just starting to get support in scalajs, and I'm not totally liking the idea of global vars anyway.
So to use sbt-buildinfo to fulfill this need, I just need to be able to configure compile-time env constants like:
buildInfoKeys in (Compile, fastOptJS) := Seq[BuildInfoKey]("contentHost" -> "localhost"),
buildInfoKeys in (Compile, fullOptJS) := Seq[BuildInfoKey]("contentHost" -> "http://example.com"),
Is there an easy fix for supporting setting buildInfoKeys when different scalajs tasks are being run? Any potential workarounds?
Using scalajs, I think sbt-buildinfo is the perfect solution for incorporating compile-time environment overrides. For instance, webpack has the
DefinePluginwhich injects globalvarsas environment-specific overrides (e.g. to compile with either dev/qa/prod hostnames). But global vars is just starting to get support in scalajs, and I'm not totally liking the idea of global vars anyway.So to use sbt-buildinfo to fulfill this need, I just need to be able to configure compile-time env constants like:
Is there an easy fix for supporting setting
buildInfoKeyswhen different scalajs tasks are being run? Any potential workarounds?