Including Build Version number in Elm programs

93 views
Skip to first unread message

kgashok

unread,
May 21, 2016, 12:20:26 PM5/21/16
to Elm Discuss
I am trying to pass in the build version number (from git) through an environment variable. 
How to gain access to the ENVIRONMENT variable value from within Elm?

Or is there an alternative approach that is recommended to including the build version number for an Elm program?

  % ashok

Max Goldstein

unread,
May 21, 2016, 1:36:30 PM5/21/16
to Elm Discuss
ENVIRONMENT variables are on the server, so it makes no sense for client-side Elm code to have access to them at runtime. Elm currently has no build-time flags, dev/test/prod environments like Rails, or other input besides the source files. If you want to have multiple versions of your Elm code controlled at compile-time, you should put them in Elm code (which can be imported as constants from wherever). You could generate this file from your ENVIRONMENT prior to running the compiler in your build process.
Message has been deleted

kgashok

unread,
May 21, 2016, 1:51:32 PM5/21/16
to Elm Discuss
Ok, thanks much! 
Reply all
Reply to author
Forward
0 new messages