We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Setting Up Development-Only Logic in Elixir Projects
249
clicks
Source: danschultzer.com
Dan Schultzer outlines a strategy for Elixir developers to manage development-specific logic separate from production code by using a special _dev directory combined with Config settings. He uses a Phoenix project as an example but mentions that this pattern can be applied to any Elixir project. Dan's approach involves updating the elixirc_paths in the mix.exs file to include the _dev files in dev and test environments and adjusting the .formatter.exs for the mix format to apply to the new directory. He also provides an example of a seed tool setup to demonstrate the use of the _dev directory for development-only modules and tools. The method helps in creating a clean separation of development and production concerns, avoiding the use of Mix.env() == :dev checks sprinkled throughout the codebase.
Related posts
© HashMerge 2024