Skip to content

Define buildInfoKeys per Task (or per "Custom" Config) scope #143

@evbo

Description

@evbo

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions